Skip to content

Commit

Permalink
chore: add slack alert when stopping EC2 instances fails in CI (#725)
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanBredehoft authored Jun 13, 2024
1 parent b4e1060 commit 847d31c
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ jobs:
)
&& steps.conformance.outcome == 'success'
&& !cancelled()
shell: bash +e {0}
run: |
if [[ "${{ env.IS_WEEKLY }}" == "true" ]]; then
Expand Down Expand Up @@ -1112,8 +1113,8 @@ jobs:
# basically when the `matrix-preparation` has not been skipped
# Side note: environmental variables cannot be used for jobs conditions, so we need to determine
# if the job should be run or not in an previous job and store it in its output
send-report:
name: Send Slack report
slack-report:
name: Slack report
runs-on: ubuntu-20.04
if: |
always()
Expand Down Expand Up @@ -1198,7 +1199,7 @@ jobs:
echo "EOF" >> "$GITHUB_ENV"
- name: Slack report
- name: Send Slack report
uses: rtCamp/action-slack-notify@4e5fb42d249be6a45a298f3c9543b111b02f7907
env:
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
Expand All @@ -1210,3 +1211,29 @@ jobs:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACKIFY_MARKDOWN: true


stop-ec2-failure-slack-alert:
name: Stop EC2 failure Slack alert
runs-on: ubuntu-20.04
if: |
always()
&& needs.matrix-preparation.result != 'skipped'
&& needs.stop-runner-linux.result == 'failure'
timeout-minutes: 2
needs:
[
matrix-preparation,
stop-runner-linux,
]

steps:
- name: Send stop EC2 failure Slack alert
uses: rtCamp/action-slack-notify@4e5fb42d249be6a45a298f3c9543b111b02f7907
env:
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png

This comment has been minimized.

Copy link
@aquint-zama

aquint-zama Jun 14, 2024

Contributor

looks like a broken link?

This comment has been minimized.

Copy link
@fd0r

fd0r Jun 18, 2024

Collaborator

indeed

SLACK_COLOR: 'failure'
SLACK_TITLE: 'Stopping EC2 instances (linux) failed ❌'
SLACK_MESSAGE: '<!channel> EC2 instances must be terminated manually as soon as possible'
SLACK_USERNAME: ${{ secrets.BOT_USERNAME }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

0 comments on commit 847d31c

Please sign in to comment.