forked from hoverlover/heroku_cijoe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ba8f32
commit 22e2f56
Showing
6 changed files
with
148 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
BUNDLE_DISABLE_SHARED_GEMS: "1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.DS_Store | ||
.rvmrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
source 'http://rubygems.org' | ||
|
||
gem 'cijoe' | ||
gem 'cijoe', :git => 'git://github.com/hoverlover/cijoe.git' | ||
gem 'sinatra' | ||
gem 'rake' | ||
gem 'bitly' | ||
gem 'twitter' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
GIT | ||
remote: git://github.com/hoverlover/cijoe.git | ||
revision: fca3db9f21a55a6326a924eaa149ffc0f05e0e0d | ||
specs: | ||
cijoe (0.5.0) | ||
choice | ||
sinatra | ||
|
||
GEM | ||
remote: http://rubygems.org/ | ||
specs: | ||
addressable (2.2.2) | ||
bitly (0.6.1) | ||
crack (>= 0.1.4) | ||
httparty (>= 0.5.2) | ||
oauth2 (>= 0.1.1) | ||
choice (0.1.4) | ||
crack (0.1.8) | ||
faraday (0.5.4) | ||
addressable (~> 2.2.2) | ||
multipart-post (~> 1.1.0) | ||
rack (>= 1.1.0, < 2) | ||
faraday_middleware (0.3.1) | ||
faraday (~> 0.5.3) | ||
hashie (0.4.0) | ||
httparty (0.6.1) | ||
crack (= 0.1.8) | ||
multi_json (0.0.5) | ||
multi_xml (0.2.0) | ||
multipart-post (1.1.0) | ||
oauth2 (0.1.1) | ||
faraday (~> 0.5.0) | ||
multi_json (~> 0.0.4) | ||
rack (1.2.1) | ||
rake (0.8.7) | ||
simple_oauth (0.1.3) | ||
sinatra (1.1.2) | ||
rack (~> 1.1) | ||
tilt (~> 1.2) | ||
tilt (1.2.1) | ||
twitter (1.1.0) | ||
faraday (~> 0.5.3) | ||
faraday_middleware (~> 0.3.1) | ||
hashie (~> 0.4.0) | ||
multi_json (~> 0.0.5) | ||
multi_xml (~> 0.2.0) | ||
simple_oauth (~> 0.1.3) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
bitly | ||
cijoe! | ||
rake | ||
sinatra | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Heroku CI Joe: Run CI Joe on Heroku! | ||
|
||
I <3 [CI Joe](https://github.com/defunkt/cijoe)! But CI Joe uses conventions that don't jive with [Heroku](http://www.heroku.com), like: | ||
|
||
* git config variables | ||
* git hooks | ||
|
||
Heroku CI Joe attempts to solve these problems so you can run the | ||
awesome goodness of CI Joe on the raddest platform out there! | ||
|
||
## Additional Features | ||
Along with the features provided by CI Joe, you also get: | ||
|
||
* Twitter integration - Tweet your build results | ||
* Automatic shortening of URLs in the build messages using [Bit.ly](http://bit.ly) | ||
|
||
If you would like to have additional notification methods or features available, feel free to | ||
fork and contribute! The ci-joe fork that actually does all the work is | ||
located [here](https://github.com/hoverlover/cijoe). | ||
|
||
## Quickstart | ||
1. Clone me | ||
2. Deploy to Heroku | ||
3. Configure | ||
4. Push some commits to your git repo | ||
5. Let the buildin' begin | ||
|
||
## Configuration | ||
CI Joe reads it's configuration from git config. This, of course, won't | ||
work on Heroku. Heroku CI Joe gets around this hurdle by using Heroku | ||
config variables. For example the CI Joe config variable `cijoe.runner` | ||
can be configured for Heroku CI Joe by executing the folowing using the | ||
heroku command: | ||
|
||
heroku config:add cijoe_runner=rake spec | ||
|
||
Notice how "." is replace by "\_" in the config variables. Any CI Joe | ||
config variable can be used in Heroku CI Joe. Simply replace the "." | ||
with "_". The following sections outline the configuration variables | ||
that are available. | ||
|
||
To tweet your build results, you will need a Twitter account, of course. | ||
Also, you will need to [register](http://dev.twitter.com/apps) the build server | ||
as a Twitter application. Once the registration is complete you will | ||
need to set the following configuration variables: | ||
|
||
* `twitter_consumer_key` | ||
* `twitter_consumer_secret` | ||
* `twitter_oauth_token` | ||
* `twitter_oauth_token_secret` | ||
|
||
### Bit.ly | ||
You can use [Bit.ly](http://bit.ly) to automatically shorten the URLs in | ||
the build messages. You will need a Bit.ly account. Once you have an | ||
account, set the following configuration variables: | ||
|
||
* `bitly_api_key` | ||
* `bitly_user_name` | ||
|
||
### CI Joe | ||
* `cijoe_buildallfile` - see the [CI Joe README](https://github.com/defunkt/cijoe/blob/master/README.md) for this variable | ||
* `cijoe_runner` - see the [CI Joe README](https://github.com/defunkt/cijoe/blob/master/README.md) for this variable | ||
* `cijoe_ci_server_url` - this is the URL for your deployed instance of | ||
Heroku CI Joe (used in the build status message) | ||
* `cijoe_git_url` - this is the URL to your git repository | ||
* `cijoe_user` - HTTP basic auth user for Heroku CI Joe | ||
* `cijoe_pass` - HTTP basic auth password for Heroku CI Joe | ||
|
||
## Caveats | ||
Heroku's platform is, for the most part, a [read-only filesystem](http://docs.heroku.com/constraints#read-only-filesystem). Heroku CI Joe writes builds to the `./tmp` directory. This means that after a build is performed, the results may or may not be available to review. If you immediately go look at the results after a build notification, I've noticed that they are generally available. If you wait for very long after the build is complete, they usually are not available. | ||
|
||
## Future Features | ||
|
||
* Writing builds to Amazon S3, or some other endpoint | ||
* Configurable build message format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
puts "Making projects directory at tmp/projects" | ||
File.mkdirp "tmp/projects" | ||
require 'rubygems' | ||
require 'bundler/setup' | ||
Bundler.require(:default) | ||
|
||
puts "Cloning git repo" | ||
`git clone https://[email protected]/bustoutsolutions/affluence.git tmp/projects/affluence` | ||
project = ENV['cijoe_git_url'].split('/').last.chomp('.git') | ||
CIJoe::Server.set :project_path, File.expand_path("tmp/projects/#{project}") | ||
|
||
puts "Starting CI Joe" | ||
`cijoe tmp/projects/affluence` | ||
|
||
puts "Done" | ||
run CIJoe::Server |