Shipr is a REST API and AngularJS client for deploying Git repositories. You give it a url to a Git repository and some config vars to set, and it will clone the repository, then run ./script/deploy within that repository, passing along the config vars as environment variables.
- You send a post request to
/api/deploys
with the repository and the config vars - The app spins up a deploy worker on Iron.io
- The worker runs the deploy script, which:
- Clones the repository
- Checks out the appropriate branch/tag/SHA
- Exports your config vars as environment variables
- Runs ./script/deploy within the cloned repository
The main goal is to make it easier to create tooling for deploying. At Remind101, we use a Robut plugin for this. This could be done with Hubot just as easily.
-
Create a heroku app
$ heroku create
-
Add the required addons
$ heroku addons:add pusher $ heroku addons:add cloudamqp $ heroku addons:add iron_worker $ heroku addons:add mongohq
-
Update heroku config
$ heroku config:set RACK_ENV=production $ heroku config:set SSH_KEY="$(cat ~/.ssh/id_rsa)" $ heroku config:set AUTH_TOKEN="$(pwgen 32 1)" $ heroku config:set DOMAIN="<app name>.herokuapp.com" $ heroku config:set GITHUB_CLIENT_ID="<client id>" $ heroku config:set GITHUB_CLIENT_SECRET="<client secret>" $ heroku config:set GITHUB_ORGANIZATION="<github org>" $ heroku config:set RABBITMQ_URL="<cloud amqp url>" $ heroku config:set RABBITMQ_MANAGEMENT_URL="<cloud amqp management url>"
-
Deploy the app
$ export $(heroku config -s | grep IRON) $ iron_worker upload workers/deploy $ git push heroku master
By default, Shipr will try to run ./script/deploy
inside your repository if
it exists. You can also specify a default script to use if none is provided via
the DEPLOY_SCRIPT_URL
environment variable. We keep our default deploy script
in a gist.
Want to work on awesome stuff like this? You should probably come work with us.