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

choose correct docker image for running db migrations

This commit is contained in:
Frederik Ring 2019-10-10 10:13:46 +02:00
parent ce1b045fc3
commit 36f555c086

View File

@ -86,12 +86,14 @@ jobs:
command: | command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then if [ "${CIRCLE_BRANCH}" == "master" ]; then
echo 'export TARGET_ENVIRONMENT="production"' >> $BASH_ENV echo 'export TARGET_ENVIRONMENT="production"' >> $BASH_ENV
echo 'export DOCKER_IMAGE_TAG="stable"' >> $BASH_ENV
else else
echo 'export TARGET_ENVIRONMENT="staging"' >> $BASH_ENV echo 'export TARGET_ENVIRONMENT="staging"' >> $BASH_ENV
echo 'export DOCKER_IMAGE_TAG="latest"' >> $BASH_ENV
fi fi
- run: - run:
name: Run database migrations name: Run database migrations
command: docker run -it offen/offen:latest migrate -conn $(aws secretsmanager get-secret-value --secret-id $TARGET_ENVIRONMENT/postgresConnectionString | jq -r '.SecretString') command: docker run -it offen/offen:$DOCKER_IMAGE_TAG migrate -conn $(aws secretsmanager get-secret-value --secret-id $TARGET_ENVIRONMENT/postgresConnectionString | jq -r '.SecretString')
- run: - run:
name: Deploy name: Deploy
command: | command: |