这是indexloc提供的服务,不要输入任何密码
Skip to content

joe-armstrong/heaven

Repository files navigation

Heaven Build Status

Heaven is a rails app that receives Deployment events from GitHub and deploys your code to heroku.

It works really well with hubot-deploy.

+---------+             +--------+            +----------+         +-------------+
|  Hubot  |             | GitHub |            |  Heaven  |         | Your Server |
+---------+             +--------+            +----------+         +-------------+
     |                      |                       |                     |
     |  Create Deployment   |                       |                     |
     |--------------------->|                       |                     |
     |                      |                       |                     |
     |  Deployment Created  |                       |                     |
     |<---------------------|                       |                     |
     |                      |                       |                     |
     |                      |   Deployment Event    |                     |
     |                      |---------------------->|                     |
     |                      |                       |     SSH+Deploys     |
     |                      |                       |-------------------->|
     |                      |                       |                     |
     |                      |   Deployment Status   |                     |
     |                      |<----------------------|                     |
     |                      |                       |                     |
     |                      |                       |   Deploy Completed  |
     |                      |                       |<--------------------|
     |                      |                       |                     |
     |                      |   Deployment Status   |                     |
     |                      |<----------------------|                     |
     |                      |                       |                     |

Configure it from a GitHub Webhook and it processes incoming payloads with resque. Heaven stores the shell output to a gist.

Heaven is just an example of what a webhook listener on a repo can do. You can set up as many systems as you need to handle your web, mobile, native, compiled, and docker images while keeping the tooling the same. You can also start evaluating new systems on a per-repo basis without introducing widespread breakage across a deployment systems userbase.

Hosting on heroku

You need redis for resque and as many workers as you think you'll need. I'd keep it at one until you start to notice queuing.

$ heroku addons:add openredis:micro
$ heroku ps:scale worker=1
$ heroku config:add GITHUB_TOKEN=<key>
Setting config vars and restarting heaven... done, v7
GITHUB_TOKEN: <key>
$ heroku config:add GITHUB_CLIENT_ID=<key>
Setting config vars and restarting heaven... done, v8
GITHUB_CLIENT_ID: <key>
$ heroku config:add GITHUB_CLIENT_SECRET=<secret>
Setting config vars and restarting heaven... done, v9
GITHUB_CLIENT_SECRET: <secret>
$ heroku config:add RAILS_SECRET_KEY_BASE=`ruby -rsecurerandom -e "print SecureRandom.hex"`
RAILS_SECRET_KEY_BASE: <secret>

Extra Environmental Variables

  • GITHUB_TEAM_ID: The GitHub team id to restrict resque access to.
  • GITHUB_TOKEN: A personal access token from your account settings, for API interaction. The token owner needs administrative rights to the repository.
  • DEPLOYMENT_PRIVATE_KEY: Only for capistrano deployments sshing into remote systems. This is an ssh private key used to login to your remote servers via SSH.
  • DEPLOYMENT_TIMEOUT: A timeout in seconds that the deployment should take. Deployments are aborted if they exceed this value. Defaults to 300 seconds.

See Also

About

🚶 Rails app for GitHub Flow

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 96.0%
  • HTML 3.1%
  • Other 0.9%