lib/cap_reserve.rb in cap_reserve-0.1.4 vs lib/cap_reserve.rb in cap_reserve-0.1.5
- old
+ new
@@ -9,12 +9,12 @@
Capistrano::Configuration.instance(:must_exist).load do
desc "Reserve environment using RESERVE=minutes"
task :maitre_d do
begin
- env, user, time, force, url, destroy =
- ENV['RESERVE_ENV'], ENV['USER'], ENV['RESERVE'], ENV['FORCE'], ENV['RESERVE_URL'], ENV['DESTROY']
+ env, user, time, force, url, destroy, branch =
+ ENV['RESERVE_ENV'], ENV['USER'], ENV['RESERVE'], ENV['FORCE'], ENV['RESERVE_URL'], ENV['DESTROY'], ENV['BRANCH']
help = <<-HELP
FORCE=1 to deploy anyway
DESTROY=1 to deploy and destroy reservation
HELP
@@ -42,10 +42,10 @@
end
create = lambda do |params|
if time
get.call("#{url}/reservations/create", {
- :environment => env, :user => user, :seconds => time.to_i * 60
+ :environment => env, :user => user, :seconds => time.to_i * 60, :branch => branch
}.merge(params))
puts "\n\e[32mReservation created\e[0m: \e[33m#{user}@#{env}\e[0m for \e[33m#{time.to_i} minutes\e[0m\n\n"
elsif destroy
res = get.call("#{url}/reservations/destroy", :environment => env)
if res['status'] == 'reserved'
\ No newline at end of file