Skip to content

Instantly share code, notes, and snippets.

@mikesprague
Created September 3, 2018 20:46
Show Gist options
  • Save mikesprague/d6f2e4ba53d8bb54889110d90d8365b3 to your computer and use it in GitHub Desktop.
Save mikesprague/d6f2e4ba53d8bb54889110d90d8365b3 to your computer and use it in GitHub Desktop.
Rollbar deploy notification (replace access token and rollbar user with your own values)
#!/bin/bash
ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENVIRONMENT=production
REVISION=`git log -n 1 --pretty=format:"%H"`
COMMENT=`cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g'`
ROLLBAR_USER=xxxxxxxxxx
curl https://api.rollbar.com/api/1/deploy/ \
-F access_token=$ACCESS_TOKEN \
-F environment=$ENVIRONMENT \
-F revision=$REVISION \
-F comment="$COMMENT" \
-F rollbar_user=$ROLLBAR_USER \
-F local_username=$ROLLBAR_USER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment