Created
July 3, 2009 10:35
-
-
Save rlivsey/140048 to your computer and use it in GitHub Desktop.
git post-receive hook to trigger different Hudson build based on the branch
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
#!/usr/bin/env ruby | |
while (input = STDIN.read) != '' | |
rev_old, rev_new, ref = input.split(" ") | |
url = nil | |
if ref == "refs/heads/master" | |
url = "http://172.23.0.150:8080/job/Project%20Master/build" | |
elsif ref == "refs/heads/other-branch" | |
url = "http://172.23.0.150:8080/job/Project%20Other/build" | |
end | |
if url | |
puts "Trigger Hudson build (#{url})" | |
`wget #{url} > /dev/null 2>&1` | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment