From 00f064410660463f00bcd58d1683e05ab9bfc83c Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 23 Nov 2014 14:11:46 +0000 Subject: [PATCH] test-bot: improve tap building. - allow using (UPSTREAM_)GIT_URL to find the tap name - push bottles to a remote based on the tap name --- Library/Homebrew/cmd/test-bot.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/test-bot.rb b/Library/Homebrew/cmd/test-bot.rb index c9a2bbd7fd..36b73b626b 100644 --- a/Library/Homebrew/cmd/test-bot.rb +++ b/Library/Homebrew/cmd/test-bot.rb @@ -546,6 +546,13 @@ module Homebrew def test_bot tap = ARGV.value('tap') + git_url = ENV['UPSTREAM_GIT_URL'] || ENV['GIT_URL'] + if !tap && git_url + # Also can get tap from Jenkins GIT_URL. + /([\w-]+\/homebrew-[\w-]+)/ =~ git_url + tap = $1 + end + if Pathname.pwd == HOMEBREW_PREFIX and ARGV.include? "--cleanup" odie 'cannot use --cleanup from HOMEBREW_PREFIX as it will delete all output.' end @@ -603,7 +610,9 @@ module Homebrew ENV["GIT_AUTHOR_EMAIL"] = ENV["GIT_COMMITTER_EMAIL"] safe_system "brew", "bottle", "--merge", "--write", *Dir["*.bottle.rb"] - remote = "git@github.com:BrewTestBot/homebrew.git" + remote_repo = tap ? tap.gsub("/", "-") : "homebrew" + + remote = "git@github.com:BrewTestBot/#{remote_repo}.git" tag = pr ? "pr-#{pr}" : "testing-#{number}" safe_system "git", "push", "--force", remote, "master:master", ":refs/tags/#{tag}"