From 0c4e29edfeb61ff4bbbbeb0d83bb3e580dd47a71 Mon Sep 17 00:00:00 2001 From: "apurvis@lumoslabs.com" Date: Mon, 6 Mar 2017 19:51:34 -0800 Subject: [PATCH 1/3] Remove --optionally - flags are optional by default and are required by required: true, not :optional --- CHANGELOG.md | 3 +++ lib/broadside/gli/commands.rb | 5 +---- lib/broadside/version.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92c0e5d..8e73f35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 3.0.7 +- `--tag` option for `bootstrap` also was named `--optional` (whoops) + # 3.0.6 - `--tag` option is optional while bootstrapping if you already have a configured `task_definition` diff --git a/lib/broadside/gli/commands.rb b/lib/broadside/gli/commands.rb index 6d30208..5579fbc 100644 --- a/lib/broadside/gli/commands.rb +++ b/lib/broadside/gli/commands.rb @@ -24,10 +24,7 @@ def add_command_flags(cmd) desc 'Bootstrap your service and task definition from the configured definition.' command :bootstrap do |bootstrap| - bootstrap.desc 'Optionally configured tag - without it you cannot bootstrap a task_definition' - bootstrap.arg_name 'TAG' - bootstrap.flag 'tag', :optional - + add_tag_flag(bootstrap) add_target_flag(bootstrap) bootstrap.action do |_, options, _| diff --git a/lib/broadside/version.rb b/lib/broadside/version.rb index 84242cc..1f891b8 100644 --- a/lib/broadside/version.rb +++ b/lib/broadside/version.rb @@ -1,3 +1,3 @@ module Broadside - VERSION = '3.0.6'.freeze + VERSION = '3.0.7'.freeze end From 5fd4d910d81bab13617959138a0502de7f144330 Mon Sep 17 00:00:00 2001 From: "apurvis@lumoslabs.com" Date: Mon, 6 Mar 2017 19:53:49 -0800 Subject: [PATCH 2/3] Error messaging --- lib/broadside/ecs/ecs_deploy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/broadside/ecs/ecs_deploy.rb b/lib/broadside/ecs/ecs_deploy.rb index 900a46f..f6214e0 100644 --- a/lib/broadside/ecs/ecs_deploy.rb +++ b/lib/broadside/ecs/ecs_deploy.rb @@ -28,7 +28,7 @@ def bootstrap info "Task definition for #{family} already exists." else raise ConfigurationError, "No :task_definition_config for #{family}" unless @target.task_definition_config - raise ConfigurationError, 'Bootstrapping a task_definition requires a --tag option' unless @target.tag + raise ConfigurationError, 'Bootstrapping a task_definition requires a :tag for the image' unless @target.tag info "Creating an initial task definition for '#{family}' from the config..." EcsManager.ecs.register_task_definition( From 8aad78b92ac56b2efac352a0046aa52a71c31ffd Mon Sep 17 00:00:00 2001 From: "apurvis@lumoslabs.com" Date: Mon, 6 Mar 2017 19:58:08 -0800 Subject: [PATCH 3/3] DRY GLI --- lib/broadside/gli/commands.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/broadside/gli/commands.rb b/lib/broadside/gli/commands.rb index 5579fbc..f36f8cf 100644 --- a/lib/broadside/gli/commands.rb +++ b/lib/broadside/gli/commands.rb @@ -22,10 +22,14 @@ def add_command_flags(cmd) add_target_flag(cmd) end +def add_deploy_flags(cmd) + add_tag_flag(cmd) + add_target_flag(cmd) +end + desc 'Bootstrap your service and task definition from the configured definition.' command :bootstrap do |bootstrap| - add_tag_flag(bootstrap) - add_target_flag(bootstrap) + add_deploy_flags(bootstrap) bootstrap.action do |_, options, _| Broadside::EcsDeploy.new(options).bootstrap @@ -57,8 +61,7 @@ def add_command_flags(cmd) run.arg_name 'COMMAND' run.flag [:command], type: Array - add_tag_flag(run) - add_target_flag(run) + add_deploy_flags(run) run.action do |_, options, _| EcsDeploy.new(options).run_commands([options[:command]], started_by: 'run') @@ -101,8 +104,7 @@ def add_command_flags(cmd) command :deploy do |d| d.desc 'Deploys WITHOUT running predeploy commands' d.command :short do |short| - add_tag_flag(short) - add_target_flag(short) + add_deploy_flags(short) short.action do |_, options, _| Broadside::EcsDeploy.new(options).short @@ -111,8 +113,7 @@ def add_command_flags(cmd) d.desc 'Deploys WITH running predeploy commands' d.command :full do |full| - add_tag_flag(full) - add_target_flag(full) + add_deploy_flags(full) full.action do |_, options, _| Broadside::EcsDeploy.new(options).full