rlivsey (owner)

Revisions

gist: 140048 Download_button fork
public
Description:
git post-receive hook to trigger different Hudson build based on the branch
Public Clone URL: git://gist.github.com/140048.git
Embed All Files: show embed
post-receive #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/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