Permalink
Browse files

add the ability to set a username differing from the repository owner…

… and the domainname of the travis installation
  • Loading branch information...
kronn committed Mar 2, 2011
1 parent cc74a1f commit fe7e21ebbb8bd5a46e24f85726aeab88b79511b1
Showing with 19 additions and 8 deletions.
  1. +13 −6 docs/travis_ci
  2. +6 −2 services/travis_ci.rb
View
@@ -7,11 +7,16 @@ 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 (just sign in with github)
2. Enter your credentials
- The token which you can find on http://travis-ci.org/profile
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)
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/svenfuchs/travis/wiki
@@ -21,5 +26,7 @@ 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_ci do |data, payload|
user = payload['repository']['owner']['name']
user = data['user'] || payload['repository']['owner']['name']
token = data['token']
domain = data['domain'] || 'http://travis-ci.org'
travis_url = URI.parse("http://#{user}:#{token}@travis-ci.org/builds")
scheme = domain.to_s.scan(/^https?/).pop || 'http'
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 fe7e21e

Please sign in to comment.