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

Merge pull request #81 from offen/server-migrations

Add setup for database migrations in server, rename field
This commit is contained in:
Frederik Ring 2019-08-02 10:38:01 +02:00 committed by GitHub
commit 6461b2cbbf

View File

@ -10,6 +10,7 @@ production_env: &production_env
- ACCOUNTS_HOST=https://accounts-alpha.offen.dev - ACCOUNTS_HOST=https://accounts-alpha.offen.dev
- HOMEPAGE_HOST=https://www.offen.dev - HOMEPAGE_HOST=https://www.offen.dev
- NODE_ENV=production - NODE_ENV=production
- SECRET_ID_SERVER_CONNECTION_STRING=alpha/server/postgresConnectionString
deploy_preconditions: &deploy_preconditions deploy_preconditions: &deploy_preconditions
requires: requires:
@ -305,6 +306,14 @@ jobs:
name: Manually clear go cache name: Manually clear go cache
command: sudo rm -rf /go/pkg/mod 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: - run:
name: Deploy name: Deploy
working_directory: ~/offen working_directory: ~/offen