Do not try to start a job when too few slurm nodes are idle. refs #1417
[arvados.git] / config / deploy.common.rb
1 before 'deploy:update_code' do
2   local_branch = `git branch | egrep '^\\*' | cut -d' ' -f2`.strip
3   remote_commit = `git ls-remote '#{fetch(:repository)}' '#{local_branch}'`.strip.split.first
4   local_commit = `git show -s --format=format:%H`.strip
5   if !local_branch.match(/^(master$|production)/)
6     abort 'You cannot deploy unless your branch is called "master" or "production*"'
7   end
8   if local_commit != remote_commit
9     puts "Current branch is #{local_branch}"
10     puts "Last commit is #{local_commit} here"
11     puts "Last commit is #{remote_commit} on #{local_branch} at #{fetch(:repository)}"
12     abort "You cannot deploy unless HEAD = a branch = head of remote branch with same name."
13   end
14   puts "Setting deploy branch to #{local_branch}"
15   set :branch, local_branch
16 end