Skip to content
This repository was archived by the owner on Jan 31, 2019. It is now read-only.

Commit 13dd823

Browse files
committed
add service hook for Travis (travis-ci.org)
1 parent 050995d commit 13dd823

3 files changed

Lines changed: 35 additions & 4 deletions

File tree

docs/github_payload

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
{
44
"data" => {
5-
"base_url" => "http://teamcity.example.com/",
6-
"build_type_id" => "bt123",
7-
"username" => "DOMAIN\\user",
8-
"password" => "MyP@ssw0rD"
5+
"token" => "token from travis-ci.org/profile"
96
},
107

118
"payload" => {

docs/travis_ci

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Travis
2+
======
3+
4+
Travis – a distributed build server tool for the Ruby community
5+
6+
7+
Install Notes
8+
-------------
9+
10+
1. Create an account on travis-ci.org (just sign in with github)
11+
2. Enter the token which you can find on http://travis-ci.org/profile
12+
3. Check the "Active" checkbox and click "Update Settings".
13+
4. Click on the "Travis CI" service name and then click the "Test Hook" link.
14+
5. You should receive an email from Travis once the build has completed
15+
16+
For more details about travis, go to http://github.com/svenfuchs/travis/wiki
17+
18+
19+
Developer Notes
20+
---------------
21+
22+
data
23+
- token
24+
25+
The payload should belong to a repository you own. The token has to belong to you, too.

services/travis_ci.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
service :travis_ci do |data, payload|
2+
user = payload['repository']['owner']['name']
3+
token = data['token']
4+
5+
travis_url = URI.parse("http://#{user}:#{token}@travis-ci.org/builds")
6+
7+
Net::HTTP.post_form(travis_url, :payload => JSON.generate(payload))
8+
nil
9+
end

0 commit comments

Comments
 (0)