diff --git a/schema/Dockerfile.local b/schema/Dockerfile.local index 7a2365e5096b27fa58350c9ca1f602fe4c57b711..81c4877c92467de19dfefefdd522285ec76d5dd8 100644 --- a/schema/Dockerfile.local +++ b/schema/Dockerfile.local @@ -1,7 +1,7 @@ # This is nrao:schema # The purpose of this is just to run the alembic migrations against the database in a docker-compose environment -FROM nrao:workspaces-base +FROM marconi.aoc.nrao.edu/ops/base:workspaces + WORKDIR /code/schema -ENV CAPO_PROFILE docker -ENTRYPOINT ["./bin/run-migrations.sh"] +ENTRYPOINT ["./bin/run-migrations.sh", "docker"] diff --git a/schema/bin/run-migrations.sh b/schema/bin/run-migrations.sh index e292f99f532df895f2896d17a360e1fec6a91640..ee68be168865c1768a3bedb5f68a4c32957c788e 100755 --- a/schema/bin/run-migrations.sh +++ b/schema/bin/run-migrations.sh @@ -2,7 +2,16 @@ # FOR USE WITH DOCKER DEVELOPMENT ENVIRONMENT ONLY. +# failfast +set -e +set -o pipefail + +if [[ $# -eq 0 ]] ; then + echo 'ERROR: run-migrations requires an argument for CAPO_PROFILE' + exit 0 +fi + # Python library installation pip install -r requirements.txt -env CAPO_PROFILE=docker alembic upgrade head +env CAPO_PROFILE=$1 alembic upgrade head