|
| 1 | +name: Poll CVMFS for release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + tag-pattern: |
| 7 | + type: string |
| 8 | + description: 'Nightly tag pattern to check for on CVMFS' |
| 9 | + default: 'NFD_*' |
| 10 | + max-tries: |
| 11 | + type: string |
| 12 | + description: 'Maximum number of polling attempts before timing out' |
| 13 | + default: '60' |
| 14 | + interval: |
| 15 | + type: string |
| 16 | + description: 'Interval in seconds between polling attempts' |
| 17 | + default: '60' |
| 18 | + workflow_call: |
| 19 | + inputs: |
| 20 | + tag-pattern: |
| 21 | + type: string |
| 22 | + description: 'Nightly tag pattern to check for on CVMFS' |
| 23 | + default: 'NFD_*' |
| 24 | + max-tries: |
| 25 | + type: string |
| 26 | + description: 'Maximum number of polling attempts before timing out' |
| 27 | + default: '60' |
| 28 | + interval: |
| 29 | + type: string |
| 30 | + description: 'Interval in seconds between polling attempts' |
| 31 | + default: '60' |
| 32 | + |
| 33 | +jobs: |
| 34 | + poll_cvmfs: |
| 35 | + runs-on: daq |
| 36 | + timeout-minutes: 90 |
| 37 | + outputs: |
| 38 | + new_release: ${{ steps.poll_release.outputs.release_tag }} |
| 39 | + steps: |
| 40 | + - name: Checkout daq-release |
| 41 | + uses: actions/checkout@v4 |
| 42 | + with: |
| 43 | + path: daq-release-cvmfs-poll |
| 44 | + ref: amogan/slack_strategy_pattern |
| 45 | + - id: poll_release |
| 46 | + run: | |
| 47 | + TAG=$(python daq-release-cvmfs-poll/scripts/github-ci/poll_cvmfs_for_release.py \ |
| 48 | + --tag-pattern ${{ inputs.tag-pattern }} \ |
| 49 | + --max-tries ${{ inputs.max-tries }}) \ |
| 50 | + --interval ${{ inputs.interval }}) |
| 51 | + echo "release_tag=$TAG" >> "$GITHUB_OUTPUT" |
| 52 | +
|
| 53 | + send_slack_message: |
| 54 | + if: | |
| 55 | + (success() || failure()) && |
| 56 | + ((github.event_name != 'workflow_dispatch') || |
| 57 | + (github.event_name == 'workflow_dispatch' && |
| 58 | + (github.event.inputs.send-slack-message == 'yes' || inputs.send-slack-message == 'yes'))) |
| 59 | + needs: [poll_cvmfs] |
| 60 | + uses: ./.github/workflows/slack-notification.yml |
| 61 | + with: |
| 62 | + workflow_name: 'Nightly release watcher' |
| 63 | + new_release_tag: ${{ needs.poll_cvmfs.outputs.new_release }} |
| 64 | + secrets: |
| 65 | + slack_webhook_url: ${{ secrets.slack_webhook_url }} |
| 66 | + |
| 67 | + cleanup: |
| 68 | + runs-on: daq |
| 69 | + steps: |
| 70 | + - name: Remove directories |
| 71 | + run: | |
| 72 | + rm -rf daq-release-cvmfs-poll |
| 73 | +
|
0 commit comments