diff options
Diffstat (limited to 'lib/leap_cli/commands/deploy.rb')
-rw-r--r-- | lib/leap_cli/commands/deploy.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/leap_cli/commands/deploy.rb b/lib/leap_cli/commands/deploy.rb index 4cfefd7..065a111 100644 --- a/lib/leap_cli/commands/deploy.rb +++ b/lib/leap_cli/commands/deploy.rb @@ -20,7 +20,7 @@ module LeapCli c.action do |global,options,args| init_submodules - nodes = manager.filter!(args) + nodes = filter_deploy_nodes(args) if nodes.size > 1 say "Deploying to these nodes: #{nodes.keys.join(', ')}" if !global[:yes] && !agree("Continue? ") @@ -141,5 +141,17 @@ module LeapCli return includes end + # + # for safety, we allow production deploys to be turned off in the Leapfile. + # + def filter_deploy_nodes(filter) + nodes = manager.filter!(filter) + if !leapfile.allow_production_deploy + nodes = nodes[:production => false] + assert! nodes.any?, "Skipping deploy because @allow_production_deploy is disabled." + end + nodes + end + end end |