Skip to content

Instantly share code, notes, and snippets.

@dpritchett
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpritchett/9251263 to your computer and use it in GitHub Desktop.
Save dpritchett/9251263 to your computer and use it in GitHub Desktop.
Spree + Heroku + Wercker continuous deployment
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: Enable virtual display
code: |-
# Start xvfb which gives the context an virtual display
# which is required for tests that require an GUI
export DISPLAY=:99.0
start-stop-daemon --start --quiet --pidfile /tmp/xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset
# Give xvfb time to start. 3 seconds is the default for all xvfb-run commands.
sleep 3
# Install (apt-get) packages
- install-packages:
packages: libqtwebkit-dev
- script:
name: rspec
code: bundle exec rspec
after-steps:
- hipchat-notify:
token: $HIPCHAT_TOKEN
room-id: $REDACTED
from-name: wercker
deploy:
steps:
- heroku-deploy:
# configurable on wercker under the settings tab
key-name: HEROKU_DEPLOY_KEY_PAIR
after-steps:
- hipchat-notify:
token: $HIPCHAT_TOKEN
room-id: $HIPCHAT_ROOM
from-name: wercker
- script:
name: Update database
code: heroku run rake db:migrate --app $HEROKU_APP_NAME
- script:
# puma boot times were angering heroku, this seems to help :(
name: pause for dramatic effect
code: sleep 5
- script:
name: Reset heroku app servers
code: heroku restart --app $HEROKU_APP_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment