From cfa375eabc69467c28dba913464f748dca219c83 Mon Sep 17 00:00:00 2001 From: George Hickman Date: Wed, 8 Nov 2023 11:18:58 +0000 Subject: [PATCH 1/3] Move deploy to depend on required-checks After merging to main the deploy action should run after everything else. Since we use required-checks to configure everything we definitely want to run we can let deploy depend on that rather than duplicating the requirements. --- .github/workflows/main.yml | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b10ac97a..93cb863b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -73,13 +73,26 @@ jobs: name: metrics-image path: /tmp/metrics.tar.gz - deploy: + required-checks: + if: always() + needs: - check - test - docker-test-and-build - lint-dockerfile + runs-on: Ubuntu-latest + + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2 + with: + jobs: ${{ toJSON(needs) }} + + deploy: + needs: [required-checks] + runs-on: ubuntu-latest permissions: @@ -121,20 +134,3 @@ jobs: ssh-add - <<< "${{ secrets.DOKKU3_DEPLOY_SSH_KEY }}" SHA=$(docker inspect --format='{{index .RepoDigests 0}}' "$PUBLIC_IMAGE_NAME":latest) ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" dokku@dokku3.ebmdatalab.net git:from-image metrics "$SHA" - - required-checks: - if: always() - - needs: - - check - - test - - docker-test-and-build - - lint-dockerfile - - runs-on: Ubuntu-latest - - steps: - - name: Decide whether the needed jobs succeeded or failed - uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2 - with: - jobs: ${{ toJSON(needs) }} From b80ec3917df5062b67fabe1c89d9e362b0171da9 Mon Sep 17 00:00:00 2001 From: George Hickman Date: Wed, 8 Nov 2023 14:30:02 +0000 Subject: [PATCH 2/3] match rough order of metrics-prod definition in metrics-dev Adding some consistency to make it a bit easier to scan the two definitions when debugging. --- docker-compose.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index eb4dc613..5d1b4c09 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -69,11 +69,6 @@ services: extends: service: metrics-prod image: metrics-dev - container_name: metrics-dev - # running as a specific uid/gid allows files written to mounted volumes by - # the docker container's default user to match the host user's uid/gid, for - # convienience. - user: ${DEV_USERID:-1000}:${DEV_GROUPID:-1000} build: # the dev stage in the Dockerfile target: metrics-dev @@ -81,6 +76,11 @@ services: args: - DEV_USERID=${DEV_USERID:-1000} - DEV_GROUPID=${DEV_GROUPID:-1000} + container_name: metrics-dev + # running as a specific uid/gid allows files written to mounted volumes by + # the docker container's default user to match the host user's uid/gid, for + # convienience. + user: ${DEV_USERID:-1000}:${DEV_GROUPID:-1000} volumes: # mount our current code - .:/app From 83fd4f4915fccae7b920cddc6baeb9d45c3739ba Mon Sep 17 00:00:00 2001 From: George Hickman Date: Wed, 8 Nov 2023 14:31:01 +0000 Subject: [PATCH 3/3] Replace env_file with environment for metrics-dev The presence of the env_file definition when there wasn't a .env on the file system appears to stop metrics-prod, a different service(!), from being able to execute. --- docker-compose.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 5d1b4c09..12d97e92 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -84,8 +84,12 @@ services: volumes: # mount our current code - .:/app - env_file: - - .env + environment: + - GITHUB_TOKEN=${GITHUB_TOKEN:-} + - SLACK_SIGNING_SECRET=${SLACK_SIGNING_SECRET:-} + - SLACK_TECH_SUPPORT_CHANNEL_ID=${SLACK_TECH_SUPPORT_CHANNEL_ID:-} + - SLACK_TOKEN=${SLACK_TOKEN:-} + - TIMESCALEDB_URL=${TIMESCALEDB_URL:-} volumes: postgres: