Updated README

This commit is contained in:
Oleg Lavrovsky 2017-05-05 16:35:06 +02:00
parent f7c567cbe8
commit d3b044e3e0
2 changed files with 14 additions and 8 deletions

View file

@ -9,14 +9,14 @@ build-cached:
build:
docker-compose build --no-cache
run:
run-here:
docker-compose stop web # for restart cases, when already running
docker-compose up
run-detached:
docker-compose up -d
run:
docker-compose up -d # detach by default
django-restart-detached:
restart:
docker-compose stop web
docker-compose up -d web
@ -27,7 +27,7 @@ migrate:
docker-compose exec web ./manage.py migrate
migrations:
docker-compose exec web ./manage.py makemigrations
docker-compose exec web ./manage.py makemigrations --merge
apply-migrations: migrations migrate
@ -77,7 +77,7 @@ django-loaddata:
gunzip ~/publichealth.home.json.gz
docker-compose exec web ./manage.py loaddata ~/publichealth.home.json
restore: django-loaddata django-restart-detached
restore: django-loaddata restart
psql:
docker-compose exec postgres psql -U postgres -d postgres

View file

@ -76,10 +76,16 @@ We use [Ansible](https://www.ansible.com) and [Docker Compose](https://docs.dock
To use Docker Compose to deploy the site, copy `ansible/roles/web/templates/docker-compose.j2` to `/docker-compose.yml` and fill in all `{{ variables }}`. This is done automatically in Ansible.
To do production deployments, you need to obtain SSH and vault keys from your system administrator (who has followed the Ansible guide to set up a vault..), and place these in a `.keys` folder. To deploy a site with a specific version:
To do production deployments, you need to obtain SSH and vault keys from your system administrator (who has followed the Ansible guide to set up a vault..), and place these in a `.keys` folder. To deploy a site:
```
ansible-playbook -s ansible/<*.yaml> -i ansible/inventories/production -e gitversion=v0.0.1
ansible-playbook -s ansible/<*.yaml> -i ansible/inventories/production
```
For an update release with a specific version, use:
```
ansible-playbook -s ansible/site.yaml -i ansible/inventories/production --tags release -e gitversion=<v*.*.*>
```
We use a StackScript to deploy to Linode, the basic system set up is to have a user in the sudoers and docker group, and a few basic system packages ready.