lib/command/ps_restart.rb in cpl-0.4.1 vs lib/command/ps_restart.rb in cpl-0.5.0

- old
+ new

@@ -6,29 +6,32 @@ OPTIONS = [ app_option(required: true), workload_option ].freeze DESCRIPTION = "Forces redeploy of workloads in app" - LONG_DESCRIPTION = <<~HEREDOC + LONG_DESCRIPTION = <<~DESC - Forces redeploy of workloads in app - HEREDOC - EXAMPLES = <<~HEREDOC + DESC + EXAMPLES = <<~EX ```sh # Forces redeploy of all workloads in app. cpl ps:restart -a $APP_NAME # Forces redeploy of a specific workload in app. cpl ps:restart -a $APP_NAME -w $WORKLOAD_NAME ``` - HEREDOC + EX def call workloads = [config.options[:workload]] if config.options[:workload] workloads ||= config[:app_workloads] + config[:additional_workloads] workloads.each do |workload| - cp.workload_force_redeployment(workload) - progress.puts "#{workload} restarted" + step("Restarting workload '#{workload}'") do + cp.fetch_workload!(workload) + + cp.workload_force_redeployment(workload) + end end end end end