[Assumptions]
- drone is used to execute the Terraform plan for the environment I own, and CI is used to check the plan results.
- The plan is executed in parallel, and when all the parallel processing is done, the slack notification plugin used in the last step is used to check result of plan and notify the success or failure of the build.
[Question]
I think the slack-notification-plugin can handle the success or failure of the build, but currently the slack-notification-plugin seems to behave as if it is handling the success or failure of the last step of the parallel processed steps.
I’d like to have it evaluate “fail” if one of the steps fails when executed in parallel, is that possible?
[Sample Code]
---.
kind: pipeline
name: infrastructure-pipeline
platform:
os: linux
arch: amd64
concurrency:
limit: 3
steps:
- name: plan for dev
image: hashicorp/terraform:0.15.4
commands:
- terraform -chdir=. /stages/dev init -reconfigure
- terraform -chdir=. /stages/dev plan
when:
event:
- pull_request
... (same steps)
- name: slack-notification
image: plugins/slack
settings:
template: "{{#success build.status}}\n Thanks @{{ build.author }} for the work :tada: {{else}}\n Something may be wrong yet :cry:\n Try fixing the issue to complete your task again :muscle:\n @{{ build.author }}} build {{build.number}} {{repo.name}}/{{build.branch}} failed :thinking_face:\n see {{build.link}} :eyes:\n{{/success}}\n"
webhook: https://hooks.slack.com/services/xxxxxxxxxxxxxxxxxxxxxxxxxxxx
when:
event:
- pull_request
status:
- success
- failure
depends_on:
- plan for dev
- plan for dev2
- plan for dev3
- plan for dev6
- plan for dev8
- plan for dev10
- plan for dev11
- plan for stg
- plan for prd