brew-test-bot: move logic from Jenkins to Ruby.
This commit is contained in:
parent
a933b58507
commit
67840c691e
@ -10,6 +10,13 @@
|
|||||||
# --email: Generate an email subject file.
|
# --email: Generate an email subject file.
|
||||||
# --no-bottle: Run brew install without --build-bottle
|
# --no-bottle: Run brew install without --build-bottle
|
||||||
# --HEAD: Run brew install with --HEAD
|
# --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 'formula'
|
||||||
require 'utils'
|
require 'utils'
|
||||||
@ -368,13 +375,40 @@ class Test
|
|||||||
cleanup_before
|
cleanup_before
|
||||||
download
|
download
|
||||||
setup unless ARGV.include? "--skip-setup"
|
setup unless ARGV.include? "--skip-setup"
|
||||||
|
if ARGV.include? '--ci-pr-upload' or ARGV.include? '--ci-testing-upload'
|
||||||
|
bottle_upload
|
||||||
|
else
|
||||||
homebrew
|
homebrew
|
||||||
formulae.each do |f|
|
formulae.each do |f|
|
||||||
formula(f)
|
formula(f)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
cleanup_after
|
cleanup_after
|
||||||
check_results
|
check_results
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
if Pathname.pwd == HOMEBREW_PREFIX and ARGV.include? "--cleanup"
|
if Pathname.pwd == HOMEBREW_PREFIX and ARGV.include? "--cleanup"
|
||||||
@ -389,6 +423,21 @@ if ARGV.include? "--email"
|
|||||||
end
|
end
|
||||||
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 = []
|
tests = []
|
||||||
any_errors = false
|
any_errors = false
|
||||||
if ARGV.named.empty?
|
if ARGV.named.empty?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user