From 2f03c678d5a942943b08da489d6bcf099fd5433c Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Fri, 13 Sep 2019 20:21:23 +0200 Subject: [PATCH] run db migrations before deploying --- .circleci/config.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bb510ea..0ebea19 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -197,15 +197,23 @@ jobs: deploy: working_directory: ~/offen docker: - - image: circleci/python:3.6 + - image: circleci/golang:1.12 steps: - checkout - run: - name: Installing deployment dependencies + name: Install deployment dependencies 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 - 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: | cp Dockerrun.aws.json.production Dockerrun.aws.json eb deploy