brew-test-bot: use Jenkins PR plugin provided URL.

This commit is contained in:
Mike McQuaid 2014-10-16 21:42:53 +01:00
parent d1ab9fc682
commit 358fd0ca19

View File

@ -222,7 +222,7 @@ module Homebrew
# Use Jenkins environment variables if present.
if no_args? and ENV['GIT_PREVIOUS_COMMIT'] and ENV['GIT_COMMIT'] \
and not ENV['ghprbPullId']
and not ENV['ghprbPullLink']
diff_start_sha1 = shorten_revision ENV['GIT_PREVIOUS_COMMIT']
diff_end_sha1 = shorten_revision ENV['GIT_COMMIT']
test "brew", "update" if current_branch == "master"
@ -233,18 +233,7 @@ module Homebrew
end
# Handle Jenkins pull request builder plugin.
if ENV['ghprbPullId'] and ENV['GIT_URL']
git_url = ENV['GIT_URL']
git_match = git_url.match %r{.*github.com[:/](\w+/\w+).*}
if git_match
github_repo = git_match[1]
pull_id = ENV['ghprbPullId']
@url = "https://github.com/#{github_repo}/pull/#{pull_id}"
@hash = nil
else
puts "Invalid 'ghprbPullId' environment variable value!"
end
end
@url = ENV['ghprbPullLink'] if ENV['ghprbPullLink']
if no_args?
if diff_start_sha1 == diff_end_sha1 or \