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.
This commit is contained in:
parent
f19ad51734
commit
14236c3950
@ -688,13 +688,16 @@ module Homebrew
|
|||||||
git "reset", "--hard", "origin/master"
|
git "reset", "--hard", "origin/master"
|
||||||
end
|
end
|
||||||
git "clean", "-ffdx"
|
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", "checkout", "-f", "master"
|
||||||
safe_system "git", "reset", "--hard", "origin/master"
|
safe_system "git", "reset", "--hard", "origin/master"
|
||||||
safe_system "git", "clean", "-ffdx", "--exclude=/Library/Taps/"
|
safe_system "git", "clean", "-ffdx", "--exclude=/Library/Taps/"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
pr_locks = "#{@repository}/.git/refs/remotes/*/pr/*/*.lock"
|
pr_locks = "#{@repository}/.git/refs/remotes/*/pr/*/*.lock"
|
||||||
Dir.glob(pr_locks) { |lock| FileUtils.rm_rf lock }
|
Dir.glob(pr_locks) { |lock| FileUtils.rm_rf lock }
|
||||||
end
|
end
|
||||||
@ -715,13 +718,17 @@ module Homebrew
|
|||||||
test "brew", "cleanup", "--prune=7"
|
test "brew", "cleanup", "--prune=7"
|
||||||
git "gc", "--auto"
|
git "gc", "--auto"
|
||||||
test "git", "clean", "-ffdx"
|
test "git", "clean", "-ffdx"
|
||||||
unless @repository == HOMEBREW_REPOSITORY
|
|
||||||
HOMEBREW_REPOSITORY.cd do
|
Tap.names.each { |s| safe_system "brew", "untap", s if s != "homebrew/core" }
|
||||||
safe_system "git", "reset", "--hard"
|
|
||||||
|
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/"
|
safe_system "git", "clean", "-ffdx", "--exclude=/Library/Taps/"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Tap.names.each { |s| safe_system "brew", "untap", s if s != "homebrew/core" }
|
|
||||||
|
|
||||||
if ARGV.include? "--local"
|
if ARGV.include? "--local"
|
||||||
FileUtils.rm_rf ENV["HOMEBREW_HOME"]
|
FileUtils.rm_rf ENV["HOMEBREW_HOME"]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user