Skip to content

Commit

Permalink
push db images
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaLRussell committed Aug 12, 2024
1 parent 143e60f commit 45905cf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/docker-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,9 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build docker images
run: ./docker/build && ./docker/db-migrate/build
run: ./docker/build && ./docker/db-migrate/build && ./db/scripts/build
- name: Push SHA tag
run: ./docker/push && ./docker/db-migrate/push
- name: Set environment variables for app
run: scripts/ci/copy-env-vars-to-dot-env-file
env:
NUXT_R_API_BASE: ${{ vars.NUXT_R_API_BASE }}
# Note - non-secret variables are stored under the 'vars' context, while secrets will be stored under the 'secrets' context
run: ./docker/push && ./docker/db-migrate/push && ./db/scripts/push
- name: Run service dependencies
run: scripts/run-dependencies
- name: Run app in docker
Expand All @@ -56,5 +51,5 @@ jobs:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Push branch tag
- name: Push branch tag on success
run: ./docker/push-branch-tag
6 changes: 6 additions & 0 deletions db/scripts/push
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euxo pipefail
HERE=$(dirname $0)
. $HERE/common

docker push "$DB_TAG_SHA"
3 changes: 3 additions & 0 deletions docker/push-branch-tag
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ HERE=$(dirname $0)
docker tag "$APP_TAG_SHA" "$APP_TAG_BRANCH"
docker push "$APP_TAG_BRANCH"

docker tag "$DB_TAG_SHA" "$DB_TAG_BRANCH"
docker push "$DB_TAG_BRANCH"

docker tag "$DB_MIGRATE_TAG_SHA" "$DB_MIGRATE_TAG_BRANCH"
docker push "$DB_MIGRATE_TAG_BRANCH"
14 changes: 5 additions & 9 deletions docker/run
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@ set -euxo pipefail
HERE=$(dirname $0)
. $HERE/common

# NB SHA images for both web app and migrate images must be built before running this script

# Migrate the db - db container and other dependencies should already be running
docker run --rm -d \
--name $DB_MIGRATE_IMAGE_NAME
--env DATABASE_URL=postgresql://daedalus-web-app-user:changeme@localhost:5432/daedalus-web-app
--env-file env.docker
"$DB_MIGRATE_TAG_SHA"

docker run --rm -d \
--name "$APP_IMAGE_NAME" \
-p 3000:3000 \
--env DATABASE_URL=postgresql://daedalus-web-app-user:changeme@localhost:5432/daedalus-web-app
--env NUXT_R_API_BASE=http://daedalus-api:8001/
--env-file env.docker
"$APP_TAG_SHA"

# TODO: Need to have build both SHA images.. maybe roll build scripts together
# TODO: docker env file
# TODO: WAIT?


# TODO: build and push db container in same pattern as app and migrate containers
# TODO: docker env file

0 comments on commit 45905cf

Please sign in to comment.