Skip to content

Instantly share code, notes, and snippets.

@miry
Created March 4, 2015 09:39
Show Gist options
  • Save miry/018e267eabda2f6985ac to your computer and use it in GitHub Desktop.
Save miry/018e267eabda2f6985ac to your computer and use it in GitHub Desktop.
ElasticBeanstalk Honeybadger deploy notification script: .ebextensions/100-honeybadger-deploy.config
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/01_notify.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
EB_CONFIG_SOURCE_BUNDLE=$(/opt/elasticbeanstalk/bin/get-config container -k source_bundle)
EB_SUPPORT_FILES=$(/opt/elasticbeanstalk/bin/get-config container -k support_files_dir)
DEPLOY_ENVS=$($EB_SUPPORT_FILES/generate_env | grep "APP_ENV\|HONEYBADGER_API_KEY")
/usr/bin/env $DEPLOY_ENVS APP_VERSION=$(unzip -z "${EB_CONFIG_SOURCE_BUNDLE}" | tail -n 1) bash -c 'curl -sd "deploy[repository]=git@github.com:applift/ad_server.git&deploy[revision]=${APP_VERSION}&deploy[local_username]=root&deploy[environment]=${APP_ENV}&api_key=${HONEYBADGER_API_KEY}" https://api.honeybadger.io/v1/deploys' > /tmp/deploy_01_notify.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment