Send an HTTP request from a shell script on deployment

Is there a way to execute a custom shell script on deployment (AWS, Rails application)? This is needed for integration with Rollbar service to track deployment changes. Here is the script code:

https://gist.github.com/evgenyneu/b15b5ab77d77d64a9869214cc4b86953

You probably already figured this out, but:

  • create a .cloud66 directory in the root of your rails application
  • put your gist into .cloud66/scripts/rollbar.sh
  • create the file .cloud66/deploy_hooks.yml with the following contents:

``` default: &default last_thing: - command: cd $RAILS_BASE_PATH/releases/$(ls -t $RAILS_BASE_PATH/releases | head -1) && sh .cloud66/scripts/rollbar.sh target: any execute: true sudo: true # not sure if you will need this?

production: «: *default

staging: «: *default

```

You might want after_rails hook instead, not sure. See http://help.cloud66.com/deployment/deploy-hooks

NOTE: for the command cd, you might be able to just use cd $STACK_PATH but not sure which hook sets that up

You must be logged in to answer this question