I added slack notification command with when: on_fail
, but it did not work when a timeout occurred.
slack_notice_on_fail:
steps:
- run:
name: 'failed notice'
command: |
curl -X POST -H 'Content-type: application/json' \
--data \
"{ \
\"text\": \"<!channel> failure\" \
}" $SLACK_WEBHOOK_URL
fi
when: on_fail
jobs:
build:
executor:
name: cloud-sdk
steps:
- checkout
- run:
name: 'build'
command: some_long_running_command.sh
no_output_timout: 1h
- slack_notice_on_fail
I prefer when: on_fail
works on timeout, too.