rosa-build/lib/tasks/remove_branch.rake

15 lines
459 B
Ruby
Raw Normal View History

2013-08-27 16:28:56 +01:00
namespace :remove_branch do
desc "Remove branch for group projects"
task :group => :environment do
branch = ENV['BRANCH']
group = ENV['GROUP']
say "START remove branch #{branch} from #{group} group"
Group.find_by_uname(group).projects.find_each do |p|
next if p.repo.branches.map(&:name).exclude?(branch)
say "===== Process #{p.name} project"
p.repo.git.native(:branch, {}, '-D', branch)
end
say 'DONE'
end
end