diff --git a/commands/blue_green_deploy_command.go b/commands/blue_green_deploy_command.go index 88c0984..ca3f174 100644 --- a/commands/blue_green_deploy_command.go +++ b/commands/blue_green_deploy_command.go @@ -36,7 +36,7 @@ func (c *BlueGreenDeployCommand) GetPluginCommand() plugin.Command { cf bg-deploy MTA [-e EXT_DESCRIPTOR[,...]] [-t TIMEOUT] [--version-rule VERSION_RULE] [-u URL] [-f] [--retries RETRIES] [--no-start] [--namespace NAMESPACE] [--apply-namespace-app-names true/false] [--apply-namespace-service-names true/false] [--apply-namespace-app-routes true/false] [--apply-namespace-as-suffix true/false ] [--delete-services] [--delete-service-keys] [--delete-service-brokers] [--keep-files] [--no-restart-subscribed-apps] [--no-confirm] [--skip-idle-start] [--do-not-fail-on-missing-permissions] [--abort-on-error] [--apps-start-timeout TIMEOUT] [--apps-stage-timeout TIMEOUT] [--apps-upload-timeout TIMEOUT] [--apps-task-execution-timeout TIMEOUT] Perform action on an active deploy operation - cf deploy -i OPERATION_ID -a ACTION [-u URL]`, + cf deploy -i OPERATION_ID -a ACTION [-u URL] ` + util.UploadEnvHelpText, Options: map[string]string{ extDescriptorsOpt: "Extension descriptors", deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.'", diff --git a/commands/deploy_command.go b/commands/deploy_command.go index 8b1ac95..a9bab3d 100644 --- a/commands/deploy_command.go +++ b/commands/deploy_command.go @@ -107,12 +107,11 @@ func (c *DeployCommand) GetPluginCommand() plugin.Command { cf deploy MTA [-e EXT_DESCRIPTOR[,...]] [-t TIMEOUT] [--version-rule VERSION_RULE] [-u URL] [-f] [--retries RETRIES] [--no-start] [--namespace NAMESPACE] [--apply-namespace-app-names true/false] [--apply-namespace-service-names true/false] [--apply-namespace-app-routes true/false] [--apply-namespace-as-suffix true/false ] [--delete-services] [--delete-service-keys] [--delete-service-brokers] [--keep-files] [--no-restart-subscribed-apps] [--do-not-fail-on-missing-permissions] [--abort-on-error] [--strategy STRATEGY] [--skip-testing-phase] [--skip-idle-start] [--apps-start-timeout TIMEOUT] [--apps-stage-timeout TIMEOUT] [--apps-upload-timeout TIMEOUT] [--apps-task-execution-timeout TIMEOUT] - Perform action on an active deploy operation cf deploy -i OPERATION_ID -a ACTION [-u URL] (EXPERIMENTAL) Deploy a multi-target app archive referenced by a remote URL - | cf deploy [-e EXT_DESCRIPTOR[,...]] [-t TIMEOUT] [--version-rule VERSION_RULE] [-u MTA_CONTROLLER_URL] [--retries RETRIES] [--no-start] [--namespace NAMESPACE] [--apply-namespace-app-names true/false] [--apply-namespace-service-names true/false] [--apply-namespace-app-routes true/false] [--apply-namespace-as-suffix true/false ] [--delete-services] [--delete-service-keys] [--delete-service-brokers] [--keep-files] [--no-restart-subscribed-apps] [--do-not-fail-on-missing-permissions] [--abort-on-error] [--strategy STRATEGY] [--skip-testing-phase] [--skip-idle-start] [--apps-start-timeout TIMEOUT] [--apps-stage-timeout TIMEOUT] [--apps-upload-timeout TIMEOUT] [--apps-task-execution-timeout TIMEOUT]`, + | cf deploy [-e EXT_DESCRIPTOR[,...]] [-t TIMEOUT] [--version-rule VERSION_RULE] [-u MTA_CONTROLLER_URL] [--retries RETRIES] [--no-start] [--namespace NAMESPACE] [--apply-namespace-app-names true/false] [--apply-namespace-service-names true/false] [--apply-namespace-app-routes true/false] [--apply-namespace-as-suffix true/false ] [--delete-services] [--delete-service-keys] [--delete-service-brokers] [--keep-files] [--no-restart-subscribed-apps] [--do-not-fail-on-missing-permissions] [--abort-on-error] [--strategy STRATEGY] [--skip-testing-phase] [--skip-idle-start] [--apps-start-timeout TIMEOUT] [--apps-stage-timeout TIMEOUT] [--apps-upload-timeout TIMEOUT] [--apps-task-execution-timeout TIMEOUT]` + util.UploadEnvHelpText, Options: map[string]string{ extDescriptorsOpt: "Extension descriptors", diff --git a/commands/download_mta_op_logs_command.go b/commands/download_mta_op_logs_command.go index d2fd75a..520e506 100644 --- a/commands/download_mta_op_logs_command.go +++ b/commands/download_mta_op_logs_command.go @@ -3,12 +3,13 @@ package commands import ( "flag" "fmt" - "github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/mtaclient" - "github.com/cloudfoundry-incubator/multiapps-cli-plugin/util" "os" "path/filepath" "strings" + "github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/mtaclient" + "github.com/cloudfoundry-incubator/multiapps-cli-plugin/util" + "code.cloudfoundry.org/cli/cf/terminal" "code.cloudfoundry.org/cli/plugin" "github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/baseclient" @@ -43,7 +44,7 @@ func (c *DownloadMtaOperationLogsCommand) GetPluginCommand() plugin.Command { UsageDetails: plugin.Usage{ Usage: `cf download-mta-op-logs -i OPERATION_ID [-d DIRECTORY] [-u URL] - cf download-mta-op-logs --mta MTA [--last NUM] [-d DIRECTORY] [-u URL]`, + cf download-mta-op-logs --mta MTA [--last NUM] [-d DIRECTORY] [-u URL]` + util.BaseEnvHelpText, Options: map[string]string{ operationIDOpt: "Operation ID", util.GetShortOption(mtaOpt): "ID of the deployed MTA", diff --git a/commands/mta_command.go b/commands/mta_command.go index a08a899..5283423 100644 --- a/commands/mta_command.go +++ b/commands/mta_command.go @@ -1,19 +1,20 @@ package commands import ( + "flag" + "fmt" + "strconv" + "strings" + "code.cloudfoundry.org/cli/cf/formatters" "code.cloudfoundry.org/cli/cf/terminal" "code.cloudfoundry.org/cli/plugin" - "flag" - "fmt" "github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/baseclient" "github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/cfrestclient" "github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/cfrestclient/resilient" "github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/models" "github.com/cloudfoundry-incubator/multiapps-cli-plugin/ui" "github.com/cloudfoundry-incubator/multiapps-cli-plugin/util" - "strconv" - "strings" ) // MtaCommand is a command for listing a deployed MTA @@ -42,7 +43,7 @@ func (c *MtaCommand) GetPluginCommand() plugin.Command { Name: "mta", HelpText: "Display health and status for a multi-target app", UsageDetails: plugin.Usage{ - Usage: "cf mta MTA_ID [--namespace NAMESPACE] [-u URL]", + Usage: "cf mta MTA_ID [--namespace NAMESPACE] [-u URL]" + util.BaseEnvHelpText, Options: map[string]string{ util.GetShortOption(namespaceOpt): "(EXPERIMENTAL) namespace of the requested mta, empty by default", deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.'", diff --git a/commands/mta_operations_command.go b/commands/mta_operations_command.go index 1a70d8c..c888e3f 100644 --- a/commands/mta_operations_command.go +++ b/commands/mta_operations_command.go @@ -1,9 +1,10 @@ package commands import ( + "flag" + "code.cloudfoundry.org/cli/cf/terminal" "code.cloudfoundry.org/cli/plugin" - "flag" "github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/baseclient" "github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/models" "github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/mtaclient" @@ -31,7 +32,7 @@ func (c *MtaOperationsCommand) GetPluginCommand() plugin.Command { Name: "mta-ops", HelpText: "List multi-target app operations", UsageDetails: plugin.Usage{ - Usage: "cf mta-ops [--mta MTA] [-u URL] [--last NUM] [--all]", + Usage: "cf mta-ops [--mta MTA] [-u URL] [--last NUM] [--all]" + util.BaseEnvHelpText, Options: map[string]string{ deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.'", util.GetShortOption(mtaOpt): "ID of the deployed package", diff --git a/commands/mtas_command.go b/commands/mtas_command.go index 25355c9..fe035de 100644 --- a/commands/mtas_command.go +++ b/commands/mtas_command.go @@ -1,9 +1,10 @@ package commands import ( + "flag" + "code.cloudfoundry.org/cli/cf/terminal" "code.cloudfoundry.org/cli/plugin" - "flag" "github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/baseclient" "github.com/cloudfoundry-incubator/multiapps-cli-plugin/ui" "github.com/cloudfoundry-incubator/multiapps-cli-plugin/util" @@ -27,7 +28,7 @@ func (c *MtasCommand) GetPluginCommand() plugin.Command { Name: "mtas", HelpText: "List all multi-target apps", UsageDetails: plugin.Usage{ - Usage: "cf mtas [-u URL]", + Usage: "cf mtas [-u URL]" + util.BaseEnvHelpText, Options: map[string]string{ deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.'", }, diff --git a/commands/purge_config_command.go b/commands/purge_config_command.go index af3196f..8cddf17 100644 --- a/commands/purge_config_command.go +++ b/commands/purge_config_command.go @@ -1,9 +1,10 @@ package commands import ( + "flag" + "code.cloudfoundry.org/cli/cf/terminal" "code.cloudfoundry.org/cli/plugin" - "flag" "github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/baseclient" "github.com/cloudfoundry-incubator/multiapps-cli-plugin/ui" "github.com/cloudfoundry-incubator/multiapps-cli-plugin/util" @@ -25,7 +26,7 @@ func (c *PurgeConfigCommand) GetPluginCommand() plugin.Command { Name: "purge-mta-config", HelpText: "Purge no longer valid configuration entries", UsageDetails: plugin.Usage{ - Usage: "cf purge-mta-config [-u URL]", + Usage: "cf purge-mta-config [-u URL]" + util.BaseEnvHelpText, Options: map[string]string{ deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.'", }, diff --git a/commands/rollback_mta_command.go b/commands/rollback_mta_command.go index f88b642..9d8e24c 100644 --- a/commands/rollback_mta_command.go +++ b/commands/rollback_mta_command.go @@ -39,7 +39,7 @@ func (c *RollbackMtaCommand) GetPluginCommand() plugin.Command { cf rollback-mta MTA_ID [-t TIMEOUT] [-f] [--retries RETRIES] [--namespace NAMESPACE] [--do-not-fail-on-missing-permissions] [--abort-on-error] [--apps-start-timeout TIMEOUT] [--apps-stage-timeout TIMEOUT] [--apps-upload-timeout TIMEOUT] [--apps-task-execution-timeout TIMEOUT] Perform action on an active deploy operation - cf rollback-mta -i OPERATION_ID -a ACTION [-u URL]`, + cf rollback-mta -i OPERATION_ID -a ACTION [-u URL]` + util.BaseEnvHelpText, Options: map[string]string{ deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.'", operationIDOpt: "Active deploy operation ID", diff --git a/commands/undeploy_command.go b/commands/undeploy_command.go index 7ac58ae..7e8ab13 100644 --- a/commands/undeploy_command.go +++ b/commands/undeploy_command.go @@ -15,7 +15,7 @@ import ( "github.com/cloudfoundry-incubator/multiapps-cli-plugin/util" ) -//UndeployCommand is a command for undeploying MTAs +// UndeployCommand is a command for undeploying MTAs type UndeployCommand struct { *BaseCommand processTypeProvider ProcessTypeProvider @@ -38,7 +38,7 @@ func (c *UndeployCommand) GetPluginCommand() plugin.Command { cf undeploy MTA_ID [-u URL] [-f] [--retries RETRIES] [--namespace NAMESPACE] [--delete-services] [--delete-service-keys] [--delete-service-brokers] [--no-restart-subscribed-apps] [--do-not-fail-on-missing-permissions] [--abort-on-error] Perform action on an active undeploy operation - cf undeploy -i OPERATION_ID -a ACTION [-u URL]`, + cf undeploy -i OPERATION_ID -a ACTION [-u URL]` + util.BaseEnvHelpText, Options: map[string]string{ deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.'", operationIDOpt: "Active undeploy operation ID", diff --git a/util/env_configuration_help.go b/util/env_configuration_help.go new file mode 100644 index 0000000..28984fa --- /dev/null +++ b/util/env_configuration_help.go @@ -0,0 +1,13 @@ +package util + +const BaseEnvHelpText = ` + +ENVIRONMENT: + DEBUG=1 Enables the logging of HTTP requests in STDOUT and STDERR. + MULTIAPPS_CONTROLLER_URL= Overrides the default deploy-service. with a custom URL. +` +const UploadEnvHelpText = BaseEnvHelpText + ` + MULTIAPPS_UPLOAD_CHUNK_SIZE= Configures chunk size (in MB) for MTAR upload. + MULTIAPPS_UPLOAD_CHUNKS_SEQUENTIALLY= Upload chunks sequentially instead of in parallel. By default is false. + MULTIAPPS_DISABLE_UPLOAD_PROGRESS_BAR= Disable upload progress bar (useful in CI/CD). By default is false. +`