#!/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