Skip to content
2019 Sandbox backend
Python Shell Makefile
Branch: develop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
deploy-scripts
hackoregon_sandbox
local_settings
nginx
requirements
scripts
tests
.cookiecutter.json
.dockerignore
.gitignore
.travis.yml
2019-sandbox-backend.code-workspace
DOCKERFILE
LICENSE
MANIFEST.in
Makefile
README.md
credentials.json.enc
docker-compose.yml
env.sample
packages.json
pytest.ini
trigger-deploy.sh

README.md

hackoregon_sandbox

PyPI version | Build Status

2019 Sandbox Backend

Documentation

The full documentation is at http://hackoregon.github.io/2019-sandbox-backend

Features

  • TODO (add what your project does)

Data Sources

This API package in this repo is based on the Data Science work in the following projects:

Quickstart to install package in your own Django Project (Non-Hack Oregon Workflow)

  • Install hackoregon_sandbox:
    pip install hackoregon_sandbox

  • Add subpackages to your INSTALLED_APPS:

    INSTALLED_APPS = [     
                        ...     
                        'api',     
                        ...
                      ]
  • Add hackoregon_sandbox's URL patterns:

    from hackoregon_sandbox.api
    import urls as api_urls   
    
    urlpatterns = [     
                    ...     
                    url(r'^', include(api_urls)),     
                    ...
                  ]
  • Setup your database with a matching schema

  • Run the project

Running Tests

This repo uses pytest and pytest-django to run tests.

For project development work, tests will be run in docker container using the bin/test.sh script:

Deployment

This repo is intended to be used in conjunction with a Travis CI based automated deploy chain to push projects to an AWS Fargate cluster

Prerequisites:

  • bumpversion - install on local computer, used for version management

Basic Steps:

  1. Branches can be pushed/merged in Github. Automated tests will be run. Unless a tagged push is made, app will not deploy

  2. When ready to deploy a new version, you'll confirm you have merged all latest code into your deployment branch (perhaps master?) and have this pulled to your local computer

  3. Create a tagged commit using bumpversion, following semantic versioning: v[major].[minor].[patch]

Lets take an example: If the current version was v1.10.4 and you wanted to update the minor portion (ie: a non-breaking but significant change), you will run the following command:

bumpversion minor --config-file ./hackoregon_sandbox/setup.cfg

this would then update the version to v1.11.0

to then create a patch update,

bumpversion patch --config-file ./hackoregon_sandbox/setup.cfg

Version will then become: v1.11.1

In the background - bumpversion checks in the setup.cfg file for any bumpversion:file entries for which to regex for the version tag syntax, which in this case is the VERSION file which contains the current version. Bumpversion then looks at the part you specify and updates that portion accordingly

Additionally and importantly for the deploy chain, it will also add a git tag with the version number.

  1. Once you have created the new tagged version of your repo, you can go ahead and push a tagged release to github:
git push origin <version-tag>
  1. Once you push this, Travis should run through it's testing/build cycle and then provided necessary env variables are configured in Travis and AWS services, deploy to the cloud.

Credits

Tools used in rendering this package:

You can’t perform that action at this time.