2
0
mirror of https://github.com/offen/website.git synced 2024-11-22 09:00:28 +01:00

Merge pull request #104 from offen/ci-migrations

Run db migrations before deploying
This commit is contained in:
Frederik Ring 2019-09-13 21:03:12 +02:00 committed by GitHub
commit b641784980

View File

@ -197,15 +197,23 @@ jobs:
deploy: deploy:
working_directory: ~/offen working_directory: ~/offen
docker: docker:
- image: circleci/python:3.6 - image: circleci/golang:1.12
steps: steps:
- checkout - checkout
- run: - run:
name: Installing deployment dependencies name: Install deployment dependencies
command: | command: |
sudo apt-get update && sudo apt-get install -qq -y python-pip libpython-dev
curl -O https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py
sudo pip install -q awscli --upgrade
sudo pip install awsebcli --upgrade sudo pip install awsebcli --upgrade
- run: - run:
name: Deploying name: Run database migrations
working_directory: ~/offen/server
command: |
go run cmd/offen/main.go migrate -conn $(aws secretsmanager get-secret-value --secret-id production/postgresConnectionString | jq -r '.SecretString')
- run:
name: Deploy
command: | command: |
cp Dockerrun.aws.json.production Dockerrun.aws.json cp Dockerrun.aws.json.production Dockerrun.aws.json
eb deploy eb deploy