I have been using circleci for a while but I am new with orbs.
As you may know, circleci is disabling its current notifications system on August 14th. In consequence, I have been forced to move to orbs.
My doubt is about status notifications for each job using circleci/slack@x.y.z
For a SINGLE job, I could do:
jobs:
build:
docker:
- image: <docker image>
steps:
- slack/notify:
channel: CHANNELID
color: '#42e2f4'
mentions: 'USERID1,USERID2,'
message: This is a custom message notification
webhook: webhook
orbs:
slack: circleci/slack@x.y.z
version: 2.1
workflows:
your-workflow:
jobs:
- build
But, what happens with multiple jobs. Is there a way to avoid code duplication, repeating under each job steps - slack/notify:
I want to avoid the following
jobs:
build:
docker:
- image: <docker image>
steps:
- checkout
- slack/notify:
channel: CHANNELID
color: '#42e2f4'
mentions: 'USERID1,USERID2,'
message: This is a custom message notification
webhook: webhook
test:
steps:
- checkout
- slack/notify:
channel: CHANNELID
color: '#42e2f4'
mentions: 'USERID1,USERID2,'
message: This is a custom message notification
webhook: webhook
lint:
steps:
- checkout
- slack/notify:
channel: CHANNELID
color: '#42e2f4'
mentions: 'USERID1,USERID2,'
message: This is a custom message notification
webhook: webhook
I would appreciate your help as any advice.
