Merge pull request #440 from csiro-internal/bugfix/roi-and-docs #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Jenkins: On push of commit or tag, trigger build" | |
| on: | |
| push: {} | |
| workflow_dispatch: | |
| inputs: | |
| gitRef: | |
| description: Branch to address. | |
| type: string | |
| required: true | |
| jobs: | |
| trigger-build: | |
| if: github.event.created == false | |
| runs-on: | |
| group: cps | |
| labels: | |
| - self-hosted | |
| - X64 | |
| - Linux | |
| - minimal | |
| env: | |
| GITHUB_GIT_REF: ${{github.ref}} | |
| GITHUB_JSON: ${{toJson(github)}} | |
| INPUT_GIT_REF: ${{inputs.gitRef}} | |
| steps: | |
| - name: Show GitHub information | |
| run: echo "${GITHUB_JSON}" | |
| - name: Get SSL certificates | |
| uses: actions/checkout@v4 | |
| with: | |
| sparse-checkout: | | |
| docker/CSIRO-Internal-CA1.crt | |
| docker/CSIRO-Internal-Root.crt | |
| sparse-checkout-cone-mode: false | |
| - name: Set up SSL certificates and format git ref for the URL and | |
| run: | | |
| # Set up SSL certificates | |
| CERTIFICATES=( | |
| docker/CSIRO-Internal-CA1.crt | |
| docker/CSIRO-Internal-Root.crt | |
| ) | |
| for CERTIFICATE in "${CERTIFICATES[@]}"; do | |
| HASH="$(openssl x509 -hash -noout -in "${CERTIFICATE}")" | |
| LINK="$(dirname "${CERTIFICATE}")/${HASH}.0" | |
| rm --force "${LINK}" | |
| ln --symbolic "$(basename "${CERTIFICATE}")" "${LINK}" | |
| done | |
| # Get git ref | |
| if test -n "${INPUT_GIT_REF}"; then | |
| GIT_REF="${INPUT_GIT_REF}" | |
| else | |
| GIT_REF="${GITHUB_GIT_REF}" | |
| fi | |
| GIT_REF="${GIT_REF/refs\/heads\//}" | |
| GIT_REF="${GIT_REF/\//%252F}" | |
| echo GIT_REF="${GIT_REF}" | tee -a "${{github.env}}" | |
| - name: Trigger build (rcvd) | |
| run: > | |
| curl | |
| --capath docker | |
| --fail-with-body | |
| --request POST | |
| --user ${{secrets.CPS_JENKINS_USER}}:${{secrets.CPS_JENKINS_TOKEN}} | |
| https://cps-ci.it.csiro.au/job/IAEA-RCVD/job/rcvd/job/${GIT_REF}/build |