Skip to content

Instantly share code, notes, and snippets.

@flyerhzm
Forked from rlivsey/post-receive
Created November 9, 2010 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flyerhzm/668910 to your computer and use it in GitHub Desktop.
Save flyerhzm/668910 to your computer and use it in GitHub Desktop.
#!/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