add one more task

This commit is contained in:
Alexander Machehin 2013-08-27 21:28:56 +06:00
parent d2ba254197
commit b0179615e7
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
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