Skip to content

Commit be4bc11

Browse files
committed
Add notification orbs.
1 parent 5ac6a2b commit be4bc11

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

jekyll/_cci2/notifications.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ order: 100
77
published: true
88
---
99

10+
* TOC
11+
{:toc}
12+
13+
1014
CircleCI has integrated chat notifications, automated email notifications, and
1115
web notifications. Slack and Email notifications are delivered on the success or failure of a
1216
[workflow]({{ site.baseurl }}/2.0/workflows/). IRC notifications are
@@ -80,3 +84,66 @@ request permission in this case. Use your browser settings to control notificati
8084
8185
While the process is similar for other browsers, please refer to their individual
8286
documentation for handling web notifications.
87+
88+
## Notifications with Orbs
89+
90+
You can use Orbs to integrate various kinds of notifications into your configuration; currently, CircleCI offers a Slack orb and an IRC orb, but several third-party orbs also exist. Consider searching the [orb registry](https://circleci.com/orbs/registry/?query=notification&filterBy=all) for _notifications_ to see what is available.
91+
92+
### Prerequisites
93+
94+
Before integrating an orb into your configuration, you will need to perform two steps: increment the `version` key in your config to `2.1` and enable `pipelines` under `Project Settings` > `Advanced Settings` in the CircleCI web application.
95+
96+
### Using the Slack Orb
97+
98+
Using the [CircleCI Slack Orb](https://circleci.com/orbs/registry/orb/circleci/slack), you can integrate and customize Slack notifications directly from your configuration file. The following config is an example of notifying a Slack channel with a custom message:
99+
100+
```yaml
101+
version: 2.1
102+
jobs:
103+
build:
104+
docker:
105+
- image: <docker image>
106+
steps:
107+
- slack/notify:
108+
color: '#42e2f4'
109+
mentions: 'USERID1,USERID2,'
110+
message: This is a custom message notification
111+
webhook: webhook
112+
orbs:
113+
slack: circleci/[email protected]
114+
version: 2.1
115+
workflows:
116+
your-workflow:
117+
jobs:
118+
- build
119+
```
120+
121+
It is also possible to use the Slack Orb to provide other types of notifications, including notifying a slack channel of a pending approval or sending a status alert at the end of a job based on success or failure. To view such usage examples, consult the [CircleCI Slack Orb page](https://circleci.com/orbs/registry/orb/circleci/slack).
122+
123+
### Using the IRC Orb
124+
125+
The [IRC orb](https://circleci.com/orbs/registry/orb/circleci/irc) is similar to the Slack orb, but only has one main feature: sending custom IRC notifications from CircleCI. Consider this example configuration:
126+
127+
```yaml
128+
version: 2.1
129+
jobs:
130+
build:
131+
docker:
132+
- image: <docker image>
133+
steps:
134+
- irc/notify:
135+
server: 'IRC-server-to-connect-to' # default: IRC_SERVER environment varible.
136+
port: '6667' # default: 6667 if left blank.
137+
channel: 'the irc server to post in' # required parmater
138+
nick: 'Your IRC nick name' # default: `circleci-bot`
139+
message: webhook # default: "Your CircleCI Job has completed."
140+
orbs:
141+
slack: circleci/[email protected]
142+
version: 2.1
143+
workflows:
144+
your-workflow:
145+
jobs:
146+
- build
147+
```
148+
149+

0 commit comments

Comments
 (0)