Commit 1e345fa97c91744eee7e8ee399d03dca375e8185

Authored by Stephen Crosby
2 parents 0f563ce8 e186347a
Exists in master and in 1 other branch production

Merge pull request #800 from stevecrozz/553_document_deploy_hooks

#553 document deploy hooks
Showing 2 changed files with 51 additions and 0 deletions   Show diff stats
README.md
... ... @@ -135,6 +135,10 @@ rake errbit:bootstrap
135 135 script/rails server
136 136 ```
137 137  
  138 +Deploy Hooks:
  139 +-------------
  140 +Errbit can track your application deploys. See [deploy hoks](docs/deploy-hooks.md)
  141 +
138 142 Deployment:
139 143 ----------
140 144 See [notes on deployment](docs/deployment.md)
... ...
docs/deploy-hooks.md 0 → 100644
... ... @@ -0,0 +1,47 @@
  1 +# Deploy Hooks
  2 +Errbit can track your application deploys if you send a special message to
  3 +Errbit whenever you deploy.
  4 +
  5 +## From heroku
  6 +If you're using heroku, you can add a deploy hook like this:
  7 +~~~bash
  8 +$ heroku addons:add deployhooks:http \
  9 + --url=http://myerrbit.com/deploys.txt
  10 +~~~
  11 +
  12 +## From the airbrake gem using the rake task
  13 +The airbrake gem comes with a nice rake task for sending deploy hooks. Assuming
  14 +you already have it configured, you can send hooks like this:
  15 +~~~bash
  16 +$ TO=env-name \
  17 + REVISION=rev-string \
  18 + REPO=repo-string \
  19 + USER=user-string \
  20 + rake airbrake:deploy
  21 +~~~
  22 +
  23 +## From the airbrake gem using capistrano 3
  24 +In your application's Capfile, insert:
  25 +~~~ruby
  26 +require 'airbrake/capistrano3'
  27 +~~~
  28 +
  29 +This will add a new capistrano task named ```airbrake:deploy``` which ends up
  30 +calling ```rake airbrake:deploy``` with the values from your capistrano config.
  31 +You may need to set the ```API_KEY``` environment variable on the target
  32 +application.
  33 +
  34 +## From curl
  35 +Errbit supports sending a message along with your deploy hook. The airbrake gem
  36 +doesn't support this, but you can easily send it along yourself. Here's an
  37 +example using cURL:
  38 +~~~bash
  39 +$ curl https://myerrbit.com/deploys.txt \
  40 + --data "api_key=406e4374bf508ad0d7732c2d35ed380d" \
  41 + --data "app_id=cb71ca8429732ba86b90d57c" \
  42 + --data "deploy[local_username]=user-string" \
  43 + --data "deploy[rails_env]=env-name" \
  44 + --data "deploy[scm_repository]=repo-string" \
  45 + --data "deploy[scm_revision]=rev-string" \
  46 + --data "deploy[message]=my-message"
  47 +~~~
... ...