Use CircleCI version 2.1 at the top of your .circleci/config.yml file.
1
version: 2.1
Add the orbs
stanza below your version, invoking the orb:
1
2
orbs:
rollbar: circleci/rollbar@0.0.3
Use rollbar
elements in your existing workflows and jobs.
A job to notify Rollbar the project has been deployed. A Rollbar access token is required to be set in the environment with the name `ROLLBAR_ACCESS_TOKEN`.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
project_environment | The Rollbar environment. Defaults to production. | No | production | string |
A step to notify Rollbar the project has been deployed. A Rollbar access token is required to be set in the environment with the name `ROLLBAR_ACCESS_TOKEN`. Add this as the last step of your the job that you use to deploy.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
project_environment | The Rollbar environment. Defaults to production. | No | production | string |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/orbs/licensing
version: 2.1
description: |
A set of commands and jobs for working with the Rollbar API. Source:
https://github.com/circleci-public/circleci-orbs
commands:
notify_deploy:
description: |
A step to notify Rollbar the project has been deployed.
A Rollbar access token is required to be set in the
environment with the name `ROLLBAR_ACCESS_TOKEN`.
Add this as the last step of your the job that you
use to deploy.
parameters:
project_environment:
type: string
default: production
description: The Rollbar environment. Defaults to production.
steps:
- run:
name: Notify Rollbar
command: |
curl https://api.rollbar.com/api/1/deploy/ \
--form access_token=$ROLLBAR_ACCESS_TOKEN \
--form environment=<< parameters.project_environment >> \
--form revision=$CIRCLE_SHA1 \
--form local_username=$CIRCLE_USERNAME
jobs:
notify_deploy:
description: |
A job to notify Rollbar the project has been deployed.
A Rollbar access token is required to be set in the
environment with the name `ROLLBAR_ACCESS_TOKEN`.
parameters:
project_environment:
type: string
default: production
description: The Rollbar environment. Defaults to production.
docker:
- image: circleci/buildpack-deps:18.04-scm
steps:
- notify_deploy:
project_environment: << parameters.project_environment >>