diff options
| author | Mike McQuaid | 2016-09-04 11:26:38 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2016-09-04 11:26:38 +0100 |
| commit | 14236c3950ffb621bc6e3795e8d8526241589b88 (patch) | |
| tree | fc0376ceef2897d6acd14890e3bfe37592507b20 /Library/Homebrew/dev-cmd/test-bot.rb | |
| parent | f19ad51734e7d68ba4d1361d942f7138345e3085 (diff) | |
| download | brew-14236c3950ffb621bc6e3795e8d8526241589b88.tar.bz2 | |
test-bot: cleanup all repositories.
The test bot currently only focuses on doing cleanup on the current tap
and the HOMEBREW_REPOSITORY. This should be extended to cover all
repositories as e.g. a syntax error in homebrew/core can break the CI
for all the other taps.
Diffstat (limited to 'Library/Homebrew/dev-cmd/test-bot.rb')
| -rw-r--r-- | Library/Homebrew/dev-cmd/test-bot.rb | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Library/Homebrew/dev-cmd/test-bot.rb b/Library/Homebrew/dev-cmd/test-bot.rb index d481f2a2d..099823a5f 100644 --- a/Library/Homebrew/dev-cmd/test-bot.rb +++ b/Library/Homebrew/dev-cmd/test-bot.rb @@ -688,13 +688,16 @@ module Homebrew git "reset", "--hard", "origin/master" end git "clean", "-ffdx" - unless @repository == HOMEBREW_REPOSITORY - HOMEBREW_REPOSITORY.cd do + + Pathname.glob("{#{HOMEBREW_REPOSITORY},#{HOMEBREW_LIBRARY}/Taps/*/*}").each do |git_repo| + next if @repository == git_repo + git_repo.cd do safe_system "git", "checkout", "-f", "master" safe_system "git", "reset", "--hard", "origin/master" safe_system "git", "clean", "-ffdx", "--exclude=/Library/Taps/" end end + pr_locks = "#{@repository}/.git/refs/remotes/*/pr/*/*.lock" Dir.glob(pr_locks) { |lock| FileUtils.rm_rf lock } end @@ -715,13 +718,17 @@ module Homebrew test "brew", "cleanup", "--prune=7" git "gc", "--auto" test "git", "clean", "-ffdx" - unless @repository == HOMEBREW_REPOSITORY - HOMEBREW_REPOSITORY.cd do - safe_system "git", "reset", "--hard" + + Tap.names.each { |s| safe_system "brew", "untap", s if s != "homebrew/core" } + + Pathname.glob("{#{HOMEBREW_REPOSITORY},#{HOMEBREW_LIBRARY}/Taps/*/*}").each do |git_repo| + next if @repository == git_repo + git_repo.cd do + safe_system "git", "checkout", "-f", "master" + safe_system "git", "reset", "--hard", "origin/master" safe_system "git", "clean", "-ffdx", "--exclude=/Library/Taps/" end end - Tap.names.each { |s| safe_system "brew", "untap", s if s != "homebrew/core" } if ARGV.include? "--local" FileUtils.rm_rf ENV["HOMEBREW_HOME"] |
