Skip to content

Instantly share code, notes, and snippets.

@joshwlewis
Created November 14, 2013 21:39
Show Gist options
  • Save joshwlewis/7474788 to your computer and use it in GitHub Desktop.
Save joshwlewis/7474788 to your computer and use it in GitHub Desktop.
Wercker configuration for Ruby 2.0, Rails 4.0, Rspec, Postgres stack with deployment to Heroku and Hipchat notifications.
box: wercker/ubuntu12.04-ruby2.0.0
services:
- wercker/postgresql
build:
steps:
- bundle-install
- rails-database-yml
- script:
name: db:setup
code: bundle exec rake db:setup
- script:
name: echo ruby information
code: |
echo "ruby version $(ruby --version) running"
echo "from location $(which ruby)"
echo -p "gem list: $(gem list)"
- script:
name: rspec
code: bundle exec rspec
after-steps:
- hipchat-notify:
token: $HIPCHAT_TOKEN
room-id: 123456
from-name: wercker
deploy:
steps:
- heroku-deploy:
key-name: WERCKER_HEROKU_KEY
- script:
name: migrate database
code: heroku run rake db:migrate --app $WERCKER_HEROKU_DEPLOY_APP_NAME
after-steps:
- hipchat-notify:
token: $HIPCHAT_TOKEN
room-id: 123456
from-name: wercker
@joshwlewis
Copy link
Author

Hopefully this will save someone some effort.

  • $WERCKER_HEROKU_KEY: needs to exist as an environment variable in a deploy target that points to an ssh-key (in Wercker's web interface). Make sure that key is added to your heroku account.
  • $HIPCHAT_TOKEN: needs to be an environment variable for your application (also in Wercker's web interface). Also, you'll need to figure out your own room-id.
  • $WERCKER_HEROKU_DEPLOY_APP_NAME: You shouldn't need to set this, this is configured by the heroku-deploy step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment