From 4e82456a4d8af37fafb40768ca51d15e8d599aa0 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Fri, 2 Aug 2019 10:31:03 +0200 Subject: [PATCH] run migration script in ci --- .circleci/config.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1a7c841..3f99942 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,6 +10,7 @@ production_env: &production_env - ACCOUNTS_HOST=https://accounts-alpha.offen.dev - HOMEPAGE_HOST=https://www.offen.dev - NODE_ENV=production + - SECRET_ID_SERVER_CONNECTION_STRING=alpha/server/postgresConnectionString deploy_preconditions: &deploy_preconditions requires: @@ -305,6 +306,14 @@ jobs: name: Manually clear go cache command: sudo rm -rf /go/pkg/mod + - run: + name: Migrate `server` database + 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 + export POSTGRES_CONNECTION_STRING=$(aws secretsmanager get-secret-value --secret-id $SECRET_ID_SERVER_CONNECTION_STRING | jq -r '.SecretString') + go run cmd/migrate/main.go - run: name: Deploy working_directory: ~/offen