Permalink
Browse files

Merge branch 'master' of https://github.com/kronn/github-services int…

…o kronn-master
  • Loading branch information...
technoweenie committed Mar 10, 2011
2 parents 7bede99 + 2bc46ed commit 3eb8b3ac5a14ab435b97b1b0f2df90a528bbc6ec
Showing with 21 additions and 10 deletions.
  1. +14 −7 docs/travis
  2. +7 −3 services/travis.rb
View
@@ -7,19 +7,26 @@ Travis – a distributed build server tool for the Ruby community
Install Notes
-------------
1. Create an account on travis-ci.org (just sign in with github)
2. Enter the token which you can find on http://travis-ci.org/profile
3. Check the "Active" checkbox and click "Update Settings".
4. Click on the "Travis CI" service name and then click the "Test Hook" link.
5. You should receive an email from Travis once the build has completed
1. Create an account (on travis-ci.org you can just sign in with github)
2. Enter your credentials
- The token which you can find on the travis profile page
Optional steps:
- Enter a username if your github username differs from the repository owner (most commonly used for company accounts)
- Enter the host of your travis-installation (defaults to http://travis-ci.org)
For more details about travis, go to http://github.com/svenfuchs/travis/wiki
3. Check the "Active" checkbox and click "Update Settings".
4. Click on the "Travis CI" service name and then click the "Test Hook" link.
5. You should receive an email from Travis once the build has completed
For more details about travis, go to http://github.com/travis-ci/travis-ci/wiki
Developer Notes
---------------
data
- token
- user
- domain
The payload should belong to a repository you own. The token has to belong to you, too.
The token has to belong to the user, of course.
View
@@ -1,9 +1,13 @@
service :travis do |data, payload|
user = payload['repository']['owner']['name']
token = data['token']
user = (data['user'] || payload['repository']['owner']['name']).strip
token = (data['token']).strip
domain = (data['domain'] || 'http://travis-ci.org').strip
travis_url = URI.parse("http://#{user}:#{token}@travis-ci.org/builds")
scheme = (domain.to_s.scan(/^https?/).pop || 'http').strip
travis_url = URI.parse("#{scheme}://#{user}:#{token}@#{domain}/builds")
Net::HTTP.post_form(travis_url, :payload => JSON.generate(payload))
nil
end

0 comments on commit 3eb8b3a

Please sign in to comment.