Skip to content

Commit

Permalink
ci: Move jenkins checks into its own workflow that executes when node…
Browse files Browse the repository at this point in the history
…-zxc-build-release artifact completes (#15928)
  • Loading branch information
rbarkerSL authored Oct 9, 2024
1 parent 90031e5 commit 78eb615
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 36 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/node-zxc-build-release-artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ on:
required: true
jf-access-token:
required: true
jenkins-integration-url:
required: false

defaults:
run:
Expand Down Expand Up @@ -389,40 +387,6 @@ jobs:
destination: ${{ secrets.cdn-bucket-name }}/node/software/v${{ needs.validate.outputs.version-prefix }}/
parent: false

- name: Notify Jenkins of Release (Integration)
id: jenkins-integration
uses: fjogeleit/http-request-action@0bd00a33db6f82063a3c6befd41f232f61d66583 # v1.15.2
if: ${{ inputs.dry-run-enabled != true && inputs.trigger-env-deploy == 'integration' && !cancelled() && !failure() }}
with:
url: ${{ secrets.jenkins-integration-url }}
data: ${{ toJSON(github.event) }}

- name: Display Jenkins Payload
env:
JSON_RESPONSE: ${{ steps.jenkins-integration.outputs.response || steps.jenkins-preview.outputs.response }}
if: ${{ inputs.trigger-env-deploy == 'integration' }}
run: |
jq '.' <<<"${JSON_RESPONSE}"
printf "### Jenkins Response Payload\n\`\`\`json\n%s\n\`\`\`\n" "$(jq '.' <<<"${JSON_RESPONSE}")" >>"${GITHUB_STEP_SUMMARY}"
- name: Check for Jenkins Failures (Integration)
if: ${{ inputs.trigger-env-deploy == 'integration' }}
env:
JSON_RESPONSE: ${{ steps.jenkins-integration.outputs.response }}
run: |
INTEGRATION_TRIGGERED="$(jq '.jobs."build-upgrade-integration".triggered' <<<"${JSON_RESPONSE}")"
DOCKER_TRIGGERED="$(jq '.jobs."build-upgrade-integration-docker".triggered' <<<"${JSON_RESPONSE}")"
if [[ "${INTEGRATION_TRIGGERED}" != true ]]; then
echo "::error title=Jenkins Trigger Failure::Failed to trigger the 'build-upgrade-integration' job via the Jenkins 'integration' pipeline!"
exit 1
fi
if [[ "${DOCKER_TRIGGERED}" != true ]]; then
echo "::error title=Jenkins Trigger Failure::Failed to trigger the 'build-upgrade-integration-docker' job via the Jenkins 'integration' pipeline!"
exit 1
fi
local-node-images:
name: Publish Local Node Images
runs-on: network-node-linux-large
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/node-zxf-deploy-integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
##
# Copyright (C) 2022-2024 Hedera Hashgraph, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##

name: "ZXF: [Node] Deploy Integration Network Release"
on:
workflow_dispatch:

workflow_run:
workflows:
- "ZXC: [Node] Deploy Release Artifacts"
types:
- completed
branches:
- develop

jobs:
jenkins-checks:
name: Build Artifact
runs-on: network-node-linux-medium
if: ${{ false }}

steps:
- name: Harden Runner
uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
with:
egress-policy: audit

- name: Notify Jenkins of Release (Integration)
id: jenkins-integration
uses: fjogeleit/http-request-action@0bd00a33db6f82063a3c6befd41f232f61d66583 # v1.15.2
with:
url: ${{ secrets.RELEASE_JENKINS_INTEGRATION_URL }}
data: ${{ toJSON(github.event) }}

- name: Display Jenkins Payload
env:
JSON_RESPONSE: ${{ steps.jenkins-integration.outputs.response }}
run: |
jq '.' <<<"${JSON_RESPONSE}"
printf "### Jenkins Response Payload\n\`\`\`json\n%s\n\`\`\`\n" "$(jq '.' <<<"${JSON_RESPONSE}")" >>"${GITHUB_STEP_SUMMARY}"
- name: Check for Jenkins Failures (Integration)
env:
JSON_RESPONSE: ${{ steps.jenkins-integration.outputs.response }}
run: |
INTEGRATION_TRIGGERED="$(jq '.jobs."build-upgrade-integration".triggered' <<<"${JSON_RESPONSE}")"
DOCKER_TRIGGERED="$(jq '.jobs."build-upgrade-integration-docker".triggered' <<<"${JSON_RESPONSE}")"
if [[ "${INTEGRATION_TRIGGERED}" != true ]]; then
echo "::error title=Jenkins Trigger Failure::Failed to trigger the 'build-upgrade-integration' job via the Jenkins 'integration' pipeline!"
exit 1
fi
if [[ "${DOCKER_TRIGGERED}" != true ]]; then
echo "::error title=Jenkins Trigger Failure::Failed to trigger the 'build-upgrade-integration-docker' job via the Jenkins 'integration' pipeline!"
exit 1
fi

0 comments on commit 78eb615

Please sign in to comment.