Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions src/rollbar/orb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1

description: |
Commands for calling the Rollbar deploy API.
Requires `curl` and `jq` commands to be available.
Requires `curl`, `git` and `jq` commands to be available.
The source for the Orb can be found here:
https://github.com/rollbar/rollbar-orb/tree/master/src/rollbar

Expand All @@ -13,6 +13,10 @@ commands:
Should be used in conjunction with notify_deploy_finished.
Command will set a BASH ENV variable ROLLBAR_DEPLOY_ID with the ID of the deploy.
parameters:
token_name:
type: env_var_name
default: ROLLBAR_ACCESS_TOKEN
description: The name of the rollbar token environment variable. Defaults to $ROLLBAR_ACCESS_TOKEN.
environment:
type: string
default: production
Expand All @@ -22,9 +26,10 @@ commands:
name: Rollbar - Notify Deploy Started
command: |
ROLLBAR_DEPLOY_ID=`curl https://api.rollbar.com/api/1/deploy/ \
--form access_token=$ROLLBAR_ACCESS_TOKEN \
--form access_token=${<< parameters.token_name >>} \
--form environment=<< parameters.environment >> \
--form revision=$CIRCLE_SHA1 \
--form comment="$(git show --no-patch --format=%s)"
--form local_username=$CIRCLE_USERNAME \
--form status=started | jq -r '.data.deploy_id'`
echo "Created deploy $ROLLBAR_DEPLOY_ID"
Expand All @@ -35,6 +40,10 @@ commands:
A step to notify Rollbar that the deploy of a project has finished.
Should be used in conjunction with notify_deploy_started.
parameters:
token_name:
type: env_var_name
default: ROLLBAR_ACCESS_TOKEN
description: The name of the rollbar token environment variable. Defaults to $ROLLBAR_ACCESS_TOKEN.
deploy_id:
type: string
description: The deploy_id of the deploy to update
Expand All @@ -46,7 +55,7 @@ commands:
name: Rollbar - Notify Deploy Finished
command: |
curl -X PATCH \
https://api.rollbar.com/api/1/deploy/<< parameters.deploy_id>>?access_token=$ROLLBAR_ACCESS_TOKEN \
https://api.rollbar.com/api/1/deploy/<< parameters.deploy_id>>?access_token=${<< parameters.token_name >>} \
--data '{"status":"<< parameters.status >>"}'

notify_deploy:
Expand All @@ -57,6 +66,10 @@ commands:
Add this as the last step of your the job that you
use to deploy.
parameters:
token_name:
type: env_var_name
default: ROLLBAR_ACCESS_TOKEN
description: The name of the rollbar token environment variable. Defaults to $ROLLBAR_ACCESS_TOKEN.
environment:
type: string
default: production
Expand All @@ -66,14 +79,19 @@ commands:
name: Rollbar - Notify Deploy Succeeded
command: |
curl https://api.rollbar.com/api/1/deploy/ \
--form access_token=$ROLLBAR_ACCESS_TOKEN \
--form access_token=${<< parameters.token_name >>} \
--form environment=<< parameters.environment >> \
--form revision=$CIRCLE_SHA1 \
--form comment="$(git show --no-patch --format=%s)"
--form local_username=$CIRCLE_USERNAME

upload_sourcemap:
description: A step to upload a sourcemap to Rollbar during a deploy.
parameters:
token_name:
type: env_var_name
default: ROLLBAR_ACCESS_TOKEN
description: The name of the rollbar token environment variable. Defaults to $ROLLBAR_ACCESS_TOKEN.
minified_url:
type: string
description: The full URL of the minified file.
Expand All @@ -93,7 +111,7 @@ commands:
done
echo $JS_FILES
curl https://api.rollbar.com/api/1/sourcemap \
-F access_token=$ROLLBAR_ACCESS_TOKEN \
-F access_token=${<< parameters.token_name >>} \
-F version=$CIRCLE_SHA1\
-F minified_url=<< parameters.minified_url >> \
-F source_map=@<< parameters.source_map >> \
Expand Down