2
0
mirror of https://github.com/offen/website.git synced 2024-10-18 12:10:25 +02:00

run migration script in ci

This commit is contained in:
Frederik Ring 2019-08-02 10:31:03 +02:00
parent 57af647dbc
commit 4e82456a4d

View File

@ -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