Skip to content

Commit

Permalink
fix need dependecny for jobs in staging deploy pipeline and set prope…
Browse files Browse the repository at this point in the history
…r node version (#1167)
  • Loading branch information
kcinay055679 authored Nov 18, 2024
1 parent cdd3b41 commit 141fd26
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/deploy-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
echo $FILES
echo "file_list=$FILES" >> $GITHUB_OUTPUT
extract-version:
read-version:
runs-on: ubuntu-latest
outputs:
okr-docker-image: ${{ vars.NEW_VALUE_URL }}:${{ steps.store-version.outputs.version}}-PROD
Expand All @@ -35,7 +35,7 @@ jobs:
id: store-version

build-docker-image:
needs: extract-version
needs: read-version
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
with:
context: .
file: docker/Dockerfile
tags: ${{ needs.extract-version.outputs.okr-docker-image}}
tags: ${{ needs.read-version.outputs.okr-docker-image}}
load: true
push: false
outputs: type=docker,dest=/tmp/okr-docker-image.tar
Expand All @@ -80,12 +80,12 @@ jobs:
path: /tmp/okr-docker-image.tar

- name: print imagetags
run: echo ${{ needs.extract-version.outputs.okr-docker-image}}
run: echo ${{ needs.read-version.outputs.okr-docker-image}}


e2e-docker:
runs-on: ubuntu-24.04
needs: [build-docker-image, extract-version, get-e2e-files]
needs: [build-docker-image, read-version, get-e2e-files]
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:

okr-deploy:
runs-on: ubuntu-latest
needs: [e2e-docker, extract-version]
needs: [e2e-docker, read-version]
steps:
- name: Checkout project
uses: actions/checkout@v4
Expand All @@ -157,7 +157,7 @@ jobs:
password: ${{ secrets.QUAY_TOKEN }}

- name: Push
run: docker push ${{ needs.extract-version.outputs.okr-docker-image}}
run: docker push ${{ needs.read-version.outputs.okr-docker-image}}

- name: Install yq
shell: bash
Expand All @@ -174,7 +174,7 @@ jobs:
COMMITPREFIX: '[CTS]'
run: |
curl -s --header "PRIVATE-TOKEN: ${{secrets.GITLAB_ACCESS_TOKEN}}" "${{vars.TARGET_GITLAB_REPOSITORY}}/files/${{vars.GITLAB_FILEPATH}}?ref=${{vars.TARGET_GITLAB_REFERENCE}}" -H "Accept: application/json" -H "Content-Type: application/json" | jq -r '.content' | base64 --decode > response.yaml
yq -i "${{vars.YAML_PATH}} = \"${{needs.extract-version.outputs.okr-docker-image}}\"" response.yaml
yq -i "${{vars.YAML_PATH}} = \"${{needs.read-version.outputs.okr-docker-image}}\"" response.yaml
UPDATED_CONTENT=$(cat response.yaml)
curl --request PUT --header 'PRIVATE-TOKEN: ${{secrets.GITLAB_ACCESS_TOKEN}}' -F "branch=${{vars.TARGET_GITLAB_REFERENCE}}" -F "[email protected]" -F "author_name=GitLab Actions" -F "content=${UPDATED_CONTENT}" -F "commit_message=$COMMITPREFIX Automated changes to ${{vars.FILEPATH_COMMIT}}" "${{vars.TARGET_GITLAB_REPOSITORY}}/files/${{vars.GITLAB_FILEPATH}}"
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/staging-deploy-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:

e2e-docker:
runs-on: ubuntu-24.04
needs: [build-docker-image,update-version]
needs: [build-docker-image,update-version,get-e2e-files]
strategy:
fail-fast: false
matrix:
Expand All @@ -135,6 +135,11 @@ jobs:
-e SPRING_PROFILES_ACTIVE=integration-test \
${{ needs.update-version.outputs.okr-docker-image}} &
- name: set node version
uses: actions/setup-node@v2
with:
node-version: ${{vars.NODE_VERSION}}

- name: Cypress run e2e tests
uses: cypress-io/github-action@v6
with:
Expand Down

0 comments on commit 141fd26

Please sign in to comment.