From e186347ace025fd7fc03372db4fb812dfc3d4e2a Mon Sep 17 00:00:00 2001 From: Stephen Crosby Date: Sun, 11 Jan 2015 21:37:44 -0800 Subject: [PATCH] refs #553 document deploy hooks --- README.md | 4 ++++ docs/deploy-hooks.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 0 deletions(-) create mode 100644 docs/deploy-hooks.md diff --git a/README.md b/README.md index 8ef681e..7351eeb 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,10 @@ rake errbit:bootstrap script/rails server ``` +Deploy Hooks: +------------- +Errbit can track your application deploys. See [deploy hoks](docs/deploy-hooks.md) + Deployment: ---------- See [notes on deployment](docs/deployment.md) diff --git a/docs/deploy-hooks.md b/docs/deploy-hooks.md new file mode 100644 index 0000000..d2e9d52 --- /dev/null +++ b/docs/deploy-hooks.md @@ -0,0 +1,47 @@ +# Deploy Hooks +Errbit can track your application deploys if you send a special message to +Errbit whenever you deploy. + +## From heroku +If you're using heroku, you can add a deploy hook like this: +~~~bash +$ heroku addons:add deployhooks:http \ + --url=http://myerrbit.com/deploys.txt +~~~ + +## From the airbrake gem using the rake task +The airbrake gem comes with a nice rake task for sending deploy hooks. Assuming +you already have it configured, you can send hooks like this: +~~~bash +$ TO=env-name \ + REVISION=rev-string \ + REPO=repo-string \ + USER=user-string \ + rake airbrake:deploy +~~~ + +## From the airbrake gem using capistrano 3 +In your application's Capfile, insert: +~~~ruby +require 'airbrake/capistrano3' +~~~ + +This will add a new capistrano task named ```airbrake:deploy``` which ends up +calling ```rake airbrake:deploy``` with the values from your capistrano config. +You may need to set the ```API_KEY``` environment variable on the target +application. + +## From curl +Errbit supports sending a message along with your deploy hook. The airbrake gem +doesn't support this, but you can easily send it along yourself. Here's an +example using cURL: +~~~bash +$ curl https://myerrbit.com/deploys.txt \ + --data "api_key=406e4374bf508ad0d7732c2d35ed380d" \ + --data "app_id=cb71ca8429732ba86b90d57c" \ + --data "deploy[local_username]=user-string" \ + --data "deploy[rails_env]=env-name" \ + --data "deploy[scm_repository]=repo-string" \ + --data "deploy[scm_revision]=rev-string" \ + --data "deploy[message]=my-message" +~~~ -- libgit2 0.21.2