Skip to content

Sample service for Devops Engineer - Day at the office assignment

Notifications You must be signed in to change notification settings

polarsteps/devops-day-at-the-office-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trips Service

Day at the office assignment - DevOps Engineer

This is a very simple service for querying and saving trips.

Requirements

  • Python 3 (>= 3.10)

Setting up

pip install -r requirements.txt

# For local test environments:
export DATABASE_URL="sqlite:///./sqlite.db"
# For other environments:
# export DATABASE_URL = "postgresql://user:password@dbserver/db"

Help

python manage.py --help

Running the service

API

export DATABASE_URL=...
python manage.py run

Scripts

These two scripts need to be run once a day:

python manage.py start-todays-trips
python manage.py end-yesterdays-trips

Testing

For tests, the DATABASE_URL is hardcoded in tests to use a sqlite database.

pytest

About

Sample service for Devops Engineer - Day at the office assignment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published