Hi there!
In part of my .drone.yml below:
---
kind: pipeline
type: kubernetes
name: after
trigger:
event:
- custom
status:
- failure
#branch:
# - master
depends_on: #Induce Parallelism on 4 workers
- test-worker-1
- test-worker-2
- test-worker-3
- test-worker-4
steps:
- name: create-slack-template
image: python
failure: ignore
commands:
- python -V
- pip install -r ./.github/scripts/requirements.txt
- python drone/create-slack-template.py #Loads .env file, creates and populates appropriate template
depends_on:
- get-run-stats
- name: release-run-slack-notification
image: plugins/slack
failure: ignore
settings:
webhook:
from_secret: SLACK_WEBHOOK_SANDBOX
channel: release-runs-cypress-drone
template: file:///drone/src/drone/release-slack.txt
depends_on:
- create-slack-template
I’m trying to figure out a way to conditionally run step release-run-slack-notification
if the step before it, create-slack-template
fails.
The step create-slack-template
checks if the drone build has a certain tag or not as an environmental variable. If it contains a tag, it runs the next step and send the slack message. If not, it shouldn’t send a slack message.
Currently, regardless of whether the drone build has a certain tag or not, the release-run-slack-notification
steps still runs. I’m somewhat getting around this by creating a line in the release-slack.txt
to show IGNORE if this tag is present. However, this creates a lot of unneeded notifications in slack with the IGNORE flag
Would love some help / advice on this! Thx!