From 37eaf3b4d28ae012de5ccb93ac39765c0f717014 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 25 Jun 2016 22:10:49 +0100 Subject: [PATCH] test-bot: fix testing job bottle upload. --- Library/Homebrew/dev-cmd/test-bot.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/dev-cmd/test-bot.rb b/Library/Homebrew/dev-cmd/test-bot.rb index 3579e9f79e..8c72c818ab 100644 --- a/Library/Homebrew/dev-cmd/test-bot.rb +++ b/Library/Homebrew/dev-cmd/test-bot.rb @@ -764,8 +764,6 @@ module Homebrew end def test_ci_upload(tap) - raise "Need a tap to upload!" unless tap - # Don't trust formulae we're uploading ENV["HOMEBREW_DISABLE_LOAD_FORMULA"] = "1" @@ -792,6 +790,14 @@ module Homebrew return if bottles.empty? FileUtils.cp bottles, Dir.pwd, :verbose => true + json_files = Dir.glob("*.bottle.json") + bottles_hash = json_files.reduce({}) do |hash, json_file| + deep_merge_hashes hash, Utils::JSON.load(IO.read(json_file)) + end + + user, repo = bottles_hash.keys.first.split("/", 3) + tap = Tap.new user, repo + ENV["GIT_AUTHOR_NAME"] = ENV["GIT_COMMITTER_NAME"] = "BrewTestBot" ENV["GIT_AUTHOR_EMAIL"] = ENV["GIT_COMMITTER_EMAIL"] = "brew-test-bot@googlegroups.com" ENV["GIT_WORK_TREE"] = tap.path @@ -811,7 +817,6 @@ module Homebrew safe_system "brew", "pull", "--clean", pull_pr end - json_files = Dir.glob("*.bottle.json") system "brew", "bottle", "--merge", "--write", *json_files remote = "git@github.com:BrewTestBot/homebrew-#{tap.repo}.git" @@ -820,10 +825,6 @@ module Homebrew formula_packaged = {} - bottles_hash = json_files.reduce({}) do |hash, json_file| - deep_merge_hashes hash, Utils::JSON.load(IO.read(json_file)) - end - bottles_hash.each do |formula_name, bottle_hash| version = bottle_hash["formula"]["pkg_version"] bintray_package = bottle_hash["bintray"]["package"]