diff options
| author | Mike McQuaid | 2013-12-10 20:14:15 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2013-12-10 20:14:15 +0000 |
| commit | a0421c719eae4b074bc22e108249534cbc279690 (patch) | |
| tree | af7e05f467e439e0c13ac89ed5a912afb75440b1 /Library | |
| parent | 38d42cfe6ff6e0836a993e06dab9d63cbb7a3106 (diff) | |
| download | homebrew-a0421c719eae4b074bc22e108249534cbc279690.tar.bz2 | |
brew-test-bot: move logic from Jenkins to Ruby.
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/Contributions/cmd/brew-test-bot.rb | 55 |
1 files changed, 52 insertions, 3 deletions
diff --git a/Library/Contributions/cmd/brew-test-bot.rb b/Library/Contributions/cmd/brew-test-bot.rb index c180db643..209852aba 100755 --- a/Library/Contributions/cmd/brew-test-bot.rb +++ b/Library/Contributions/cmd/brew-test-bot.rb @@ -10,6 +10,13 @@ # --email: Generate an email subject file. # --no-bottle: Run brew install without --build-bottle # --HEAD: Run brew install with --HEAD +# --local: Output logs and cache downloads under ./{logs,cache} +# +# --ci-master: Shortcut for Homebrew master branch CI options. +# --ci-pr: Shortcut for Homebrew pull request CI options. +# --ci-testing: Shortcut for Homebrew testing CI options. +# --ci-pr-upload: Homebrew CI pull request bottle upload. +# --ci-testing-upload: Homebrew CI testing bottle upload. require 'formula' require 'utils' @@ -368,13 +375,40 @@ class Test cleanup_before download setup unless ARGV.include? "--skip-setup" - homebrew - formulae.each do |f| - formula(f) + if ARGV.include? '--ci-pr-upload' or ARGV.include? '--ci-testing-upload' + bottle_upload + else + homebrew + formulae.each do |f| + formula(f) + end end cleanup_after check_results end + + def bottle_upload + @category = __method__ + jenkins = ENV['JENKINS_HOME'] + job = ENV['UPSTREAM_JOB_NAME'] + id = ENV['UPSTREAM_BUILD_ID'] + raise "Missing Jenkins variables!" unless jenkins and job and id + + test "cp #{jenkins}/jobs/'#{job}'/configurations/axis-version/*/builds/#{id}/archive/*.bottle*.* ." + test "brew bottle --merge --write *.bottle*.rb" + + remote = "https://github.com/BrewTestBot/homebrew.git" + pr = ENV['UPSTREAM_PULL_REQUEST'] + tag = pr ? "pr-#{pr}" : "testing-#{id}" + test "git push --force #{remote} :refs/tags/#{tag}" + + path = "/home/frs/project/m/ma/machomebrew/Bottles/" + url = "mikemcquaid,machomebrew@frs.sourceforge.net:#{path}" + options = "--partial --progress --human-readable --compress" + test "rsync #{options} *.bottle.tar.gz #{url}" + test "git tag --force #{tag}" + test "git push --force #{remote} refs/tags/#{tag}" + end end if Pathname.pwd == HOMEBREW_PREFIX and ARGV.include? "--cleanup" @@ -389,6 +423,21 @@ if ARGV.include? "--email" end end +ENV['HOMEBREW_DEVELOPER'] = '1' +ENV['HOMEBREW_NO_EMOJI'] = '1' +if ARGV.include? '--ci-master' or ARGV.include? '--ci-pr' \ + or ARGV.include? '--ci-testing' + ARGV << '--cleanup' << '--junit' << '--local' +end +if ARGV.include? '--ci-master' + ARGV << '--no-bottle' << '--email' +end + +if ARGV.include? '--local' + ENV['HOMEBREW_LOGS'] = "#{Dir.pwd}/logs" + ENV['HOMEBREW_CACHE'] = "#{Dir.pwd}/cache" +end + tests = [] any_errors = false if ARGV.named.empty? |
