Automated deployments to {tournament-name}.nu-tab.com
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Retry failed droplet creation (#74) Feb 12, 2019
config Replace os.system with subprocess.check_call (#75) Feb 13, 2019
data/nginx Set up SSL (#68) Jan 15, 2019
deployer Replace os.system with subprocess.check_call (#75) Feb 13, 2019
migrations Migrations for active column (#57) Apr 30, 2018
.codeclimate.yml Code cleanup (#30) Sep 3, 2017
.env Env vars Jan 18, 2019
.gitignore Set up SSL (#68) Jan 15, 2019
.python-version Add buy me a coffee button (#39) Jan 24, 2018
Dockerfile.web Switch database to sqlite (#54) Apr 24, 2018
README.md TODO == TODONE Jan 18, 2019
__init__.py Get the db working Jul 3, 2017
codeship-services.yml Replace Redis with SQS (#66) Jan 14, 2019
codeship-steps.yml Integrate Codeship for CI (#2) Jul 3, 2017
docker-compose.yml
init-letsencrypt.sh Set up SSL (#68) Jan 15, 2019
requirements.txt Replace os.system with subprocess.check_call (#75) Feb 13, 2019

README.md

Codeship Status for BenMusch/mittab-deploy

This is an application to handle automatic deployments of the mit-tab application

What this application does

  • Deploys an instance of mit-tab to a Digital Oceal droplet (using Digital Ocean's remote Docker hosts)
  • Creates a DNS record at {tournament}.nu-tab.com that maps to that droplet's IP address using the Digital Ocean DNS services
  • Useful scripts to backup tournaments

TODO:

  • Automate tournament deletion
  • Automate staging deploys with PRs to mit-tab

Installation and Running

This application requires you to have docker and docker-compose installed. You can also run it via virtualenv locally. You will need the AWS credentials to test this. Email me.

It is not recommended to use docker for local development, because docker also handles things like the SSL certs, so stuff just gets kinda annoying to work with. Instead, use virtualenv. I find it convenient to add this to the postactivate script:

export $(grep -v '^#' .env | xargs -0)
export $(grep -v '^#' .env.secret | xargs -0)

And this to the postdeactivate script:

unset $(grep -v '^#' .env | sed -E 's/(.*)=.*/\1/' | xargs -d '\n')
unset $(grep -v '^#' .env.secret | sed -E 's/(.*)=.*/\1/' | xargs -d '\n')

Environment Variables

Most env vars are defined in .env. My API keys are not in there for obvious reasons, so code that hits APIs will not function until I figure out how to mock it

Deployment

On each commit to master, the server pulls the code. However, the docker containers need to be manually restarted (TODO?)