Skip to content

Commit

Permalink
Split promote-images into promote-images-dev and promote-images-prod
Browse files Browse the repository at this point in the history
  • Loading branch information
jcgruenhage committed Jan 3, 2025
1 parent e9d30ed commit 3576bc5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
# SC2086 - Double quote to prevent globbing and word splitting. - https://www.shellcheck.net/wiki/SC2086
SHELLCHECK_OPTS: --exclude=SC2046,SC2086
with:
fail_on_error: true
fail_level: error
filter_mode: nofilter
level: error

Expand Down
39 changes: 29 additions & 10 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ jobs:
trigger-e2e-tests:
if: ${{ !github.event.pull_request.draft || contains( github.event.pull_request.labels.*.name, 'run-e2e-tests-in-draft') || github.ref_name == 'main' || github.ref_name == 'release' || github.ref_name == 'release-proxy' || github.ref_name == 'release-compute' }}
needs: [ check-permissions, promote-images, tag ]
needs: [ check-permissions, promote-images-dev, tag ]
uses: ./.github/workflows/trigger-e2e-tests.yml
secrets: inherit

Expand Down Expand Up @@ -930,8 +930,8 @@ jobs:
docker compose -f ./docker-compose/docker-compose.yml logs || 0
docker compose -f ./docker-compose/docker-compose.yml down
promote-images:
needs: [ check-permissions, tag, test-images, vm-compute-node-image ]
promote-images-dev:
needs: [ check-permissions, tag, vm-compute-node-image ]
runs-on: ubuntu-22.04

permissions:
Expand Down Expand Up @@ -965,6 +965,25 @@ jobs:
neondatabase/vm-compute-node-${version}:${{ needs.tag.outputs.build-tag }}
done
promote-images-prod:
needs: [ check-permissions, tag, test-images, vm-compute-node-image ]
runs-on: ubuntu-22.04
if: github.ref_name == 'main || github.ref_name == 'release' || github.ref_name == 'release-proxy' || github.ref_name == 'release-compute'

Check failure on line 971 in .github/workflows/build_and_test.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/build_and_test.yml#L971

parser did not reach end of input after parsing the expression. 5 remaining token(s) in the input: "IDENT", "STRING", "IDENT", "STRING", "IDENT" [expression]
Raw output
.github/workflows/build_and_test.yml:971:57: parser did not reach end of input after parsing the expression. 5 remaining token(s) in the input: "IDENT", "STRING", "IDENT", "STRING", "IDENT" [expression]

permissions:
id-token: write # aws-actions/configure-aws-credentials
statuses: write
contents: read

env:
VERSIONS: v14 v15 v16 v17

steps:
- uses: docker/login-action@v3
with:
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}

- name: Add latest tag to images
if: github.ref_name == 'main'
run: |
Expand Down Expand Up @@ -1010,7 +1029,7 @@ jobs:
push-to-acr-dev:
if: github.ref_name == 'main'
needs: [ tag, promote-images ]
needs: [ tag, promote-images-dev ]
uses: ./.github/workflows/_push-to-acr.yml
with:
client_id: ${{ vars.AZURE_DEV_CLIENT_ID }}
Expand All @@ -1022,7 +1041,7 @@ jobs:

push-to-acr-prod:
if: github.ref_name == 'release' || github.ref_name == 'release-proxy' || github.ref_name == 'release-compute'
needs: [ tag, promote-images ]
needs: [ tag, promote-images-prod ]
uses: ./.github/workflows/_push-to-acr.yml
with:
client_id: ${{ vars.AZURE_PROD_CLIENT_ID }}
Expand Down Expand Up @@ -1112,12 +1131,12 @@ jobs:
exit 1
deploy:
needs: [ check-permissions, promote-images, tag, build-and-test-locally, trigger-custom-extensions-build-and-wait, push-to-acr-dev, push-to-acr-prod ]
needs: [ check-permissions, promote-images-prod, tag, build-and-test-locally, trigger-custom-extensions-build-and-wait, push-to-acr-dev, push-to-acr-prod ]
# `!failure() && !cancelled()` is required because the workflow depends on the job that can be skipped: `push-to-acr-dev` and `push-to-acr-prod`
if: (github.ref_name == 'main' || github.ref_name == 'release' || github.ref_name == 'release-proxy' || github.ref_name == 'release-compute') && !failure() && !cancelled()
permissions:
id-token: write # aws-actions/configure-aws-credentials
statuses: write
sta(tuses: write

Check failure on line 1139 in .github/workflows/build_and_test.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/build_and_test.yml#L1139

unknown permission scope "sta(tuses". all available permission scopes are "actions", "attestations", "checks", "contents", "deployments", "discussions", "id-token", "issues", "packages", "pages", "pull-requests", "repository-projects", "security-events", "statuses" [permissions]
Raw output
.github/workflows/build_and_test.yml:1139:7: unknown permission scope "sta(tuses". all available permission scopes are "actions", "attestations", "checks", "contents", "deployments", "discussions", "id-token", "issues", "packages", "pages", "pull-requests", "repository-projects", "security-events", "statuses" [permissions]
contents: write
runs-on: [ self-hosted, small ]
container: 369495373322.dkr.ecr.eu-central-1.amazonaws.com/ansible:latest
Expand Down Expand Up @@ -1333,9 +1352,9 @@ jobs:
done
pin-build-tools-image:
needs: [ build-build-tools-image, promote-images, build-and-test-locally ]
needs: [ build-build-tools-image, promote-images-prod, build-and-test-locally ]
if: github.ref_name == 'main'
uses: ./.github/workflows/pin-build-tools-image.yml
uses: ./.github/workflows/pin-build-tools-image.y(ml

Check failure on line 1357 in .github/workflows/build_and_test.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/build_and_test.yml#L1357

could not read reusable workflow file for "./.github/workflows/pin-build-tools-image.y(ml": open /github/workspace/.github/workflows/pin-build-tools-image.y(ml: no such file or directory [workflow-call]
Raw output
.github/workflows/build_and_test.yml:1357:11: could not read reusable workflow file for "./.github/workflows/pin-build-tools-image.y(ml": open /github/workspace/.github/workflows/pin-build-tools-image.y(ml: no such file or directory [workflow-call]
with:
from-tag: ${{ needs.build-build-tools-image.outputs.image-tag }}
secrets: inherit
Expand All @@ -1356,7 +1375,7 @@ jobs:
- build-and-test-locally
- check-codestyle-python
- check-codestyle-rust
- promote-images
- promote-images-dev
- test-images
- trigger-custom-extensions-build-and-wait
runs-on: ubuntu-22.04
Expand Down

0 comments on commit 3576bc5

Please sign in to comment.