Skip to content

Commit bcc3c54

Browse files
committed
Print env configuration in the help of mta commands
LMCROSSITXSADEPLOY-2853
1 parent cf39f6a commit bcc3c54

10 files changed

+37
-20
lines changed

commands/blue_green_deploy_command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (c *BlueGreenDeployCommand) GetPluginCommand() plugin.Command {
3636
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]
3737
3838
Perform action on an active deploy operation
39-
cf deploy -i OPERATION_ID -a ACTION [-u URL]`,
39+
cf deploy -i OPERATION_ID -a ACTION [-u URL] ` + util.UploadEnvHelpText,
4040
Options: map[string]string{
4141
extDescriptorsOpt: "Extension descriptors",
4242
deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.<system-domain>'",

commands/deploy_command.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,11 @@ func (c *DeployCommand) GetPluginCommand() plugin.Command {
107107
108108
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]
109109
110-
111110
Perform action on an active deploy operation
112111
cf deploy -i OPERATION_ID -a ACTION [-u URL]
113112
114113
(EXPERIMENTAL) Deploy a multi-target app archive referenced by a remote URL
115-
<write MTA archive URL to STDOUT> | 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]`,
114+
<write MTA archive URL to STDOUT> | 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,
116115

117116
Options: map[string]string{
118117
extDescriptorsOpt: "Extension descriptors",

commands/download_mta_op_logs_command.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package commands
33
import (
44
"flag"
55
"fmt"
6-
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/mtaclient"
7-
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/util"
86
"os"
97
"path/filepath"
108
"strings"
119

10+
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/mtaclient"
11+
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/util"
12+
1213
"code.cloudfoundry.org/cli/cf/terminal"
1314
"code.cloudfoundry.org/cli/plugin"
1415
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/baseclient"
@@ -43,7 +44,7 @@ func (c *DownloadMtaOperationLogsCommand) GetPluginCommand() plugin.Command {
4344
UsageDetails: plugin.Usage{
4445
Usage: `cf download-mta-op-logs -i OPERATION_ID [-d DIRECTORY] [-u URL]
4546
46-
cf download-mta-op-logs --mta MTA [--last NUM] [-d DIRECTORY] [-u URL]`,
47+
cf download-mta-op-logs --mta MTA [--last NUM] [-d DIRECTORY] [-u URL]` + util.BaseEnvHelpText,
4748
Options: map[string]string{
4849
operationIDOpt: "Operation ID",
4950
util.GetShortOption(mtaOpt): "ID of the deployed MTA",

commands/mta_command.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
package commands
22

33
import (
4+
"flag"
5+
"fmt"
6+
"strconv"
7+
"strings"
8+
49
"code.cloudfoundry.org/cli/cf/formatters"
510
"code.cloudfoundry.org/cli/cf/terminal"
611
"code.cloudfoundry.org/cli/plugin"
7-
"flag"
8-
"fmt"
912
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/baseclient"
1013
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/cfrestclient"
1114
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/cfrestclient/resilient"
1215
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/models"
1316
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/ui"
1417
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/util"
15-
"strconv"
16-
"strings"
1718
)
1819

1920
// MtaCommand is a command for listing a deployed MTA
@@ -42,7 +43,7 @@ func (c *MtaCommand) GetPluginCommand() plugin.Command {
4243
Name: "mta",
4344
HelpText: "Display health and status for a multi-target app",
4445
UsageDetails: plugin.Usage{
45-
Usage: "cf mta MTA_ID [--namespace NAMESPACE] [-u URL]",
46+
Usage: "cf mta MTA_ID [--namespace NAMESPACE] [-u URL]" + util.BaseEnvHelpText,
4647
Options: map[string]string{
4748
util.GetShortOption(namespaceOpt): "(EXPERIMENTAL) namespace of the requested mta, empty by default",
4849
deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.<system-domain>'",

commands/mta_operations_command.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package commands
22

33
import (
4+
"flag"
5+
46
"code.cloudfoundry.org/cli/cf/terminal"
57
"code.cloudfoundry.org/cli/plugin"
6-
"flag"
78
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/baseclient"
89
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/models"
910
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/mtaclient"
@@ -31,7 +32,7 @@ func (c *MtaOperationsCommand) GetPluginCommand() plugin.Command {
3132
Name: "mta-ops",
3233
HelpText: "List multi-target app operations",
3334
UsageDetails: plugin.Usage{
34-
Usage: "cf mta-ops [--mta MTA] [-u URL] [--last NUM] [--all]",
35+
Usage: "cf mta-ops [--mta MTA] [-u URL] [--last NUM] [--all]" + util.BaseEnvHelpText,
3536
Options: map[string]string{
3637
deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.<system-domain>'",
3738
util.GetShortOption(mtaOpt): "ID of the deployed package",

commands/mtas_command.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package commands
22

33
import (
4+
"flag"
5+
46
"code.cloudfoundry.org/cli/cf/terminal"
57
"code.cloudfoundry.org/cli/plugin"
6-
"flag"
78
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/baseclient"
89
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/ui"
910
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/util"
@@ -27,7 +28,7 @@ func (c *MtasCommand) GetPluginCommand() plugin.Command {
2728
Name: "mtas",
2829
HelpText: "List all multi-target apps",
2930
UsageDetails: plugin.Usage{
30-
Usage: "cf mtas [-u URL]",
31+
Usage: "cf mtas [-u URL]" + util.BaseEnvHelpText,
3132
Options: map[string]string{
3233
deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.<system-domain>'",
3334
},

commands/purge_config_command.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package commands
22

33
import (
4+
"flag"
5+
46
"code.cloudfoundry.org/cli/cf/terminal"
57
"code.cloudfoundry.org/cli/plugin"
6-
"flag"
78
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/baseclient"
89
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/ui"
910
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/util"
@@ -25,7 +26,7 @@ func (c *PurgeConfigCommand) GetPluginCommand() plugin.Command {
2526
Name: "purge-mta-config",
2627
HelpText: "Purge no longer valid configuration entries",
2728
UsageDetails: plugin.Usage{
28-
Usage: "cf purge-mta-config [-u URL]",
29+
Usage: "cf purge-mta-config [-u URL]" + util.BaseEnvHelpText,
2930
Options: map[string]string{
3031
deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.<system-domain>'",
3132
},

commands/rollback_mta_command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (c *RollbackMtaCommand) GetPluginCommand() plugin.Command {
3939
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]
4040
4141
Perform action on an active deploy operation
42-
cf rollback-mta -i OPERATION_ID -a ACTION [-u URL]`,
42+
cf rollback-mta -i OPERATION_ID -a ACTION [-u URL]` + util.BaseEnvHelpText,
4343
Options: map[string]string{
4444
deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.<system-domain>'",
4545
operationIDOpt: "Active deploy operation ID",

commands/undeploy_command.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"github.com/cloudfoundry-incubator/multiapps-cli-plugin/util"
1616
)
1717

18-
//UndeployCommand is a command for undeploying MTAs
18+
// UndeployCommand is a command for undeploying MTAs
1919
type UndeployCommand struct {
2020
*BaseCommand
2121
processTypeProvider ProcessTypeProvider
@@ -38,7 +38,7 @@ func (c *UndeployCommand) GetPluginCommand() plugin.Command {
3838
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]
3939
4040
Perform action on an active undeploy operation
41-
cf undeploy -i OPERATION_ID -a ACTION [-u URL]`,
41+
cf undeploy -i OPERATION_ID -a ACTION [-u URL]` + util.BaseEnvHelpText,
4242
Options: map[string]string{
4343
deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.<system-domain>'",
4444
operationIDOpt: "Active undeploy operation ID",

util/env_configuration_help.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package util
2+
3+
const BaseEnvHelpText = `
4+
5+
ENVIRONMENT:
6+
DEBUG=1 Enables the logging of HTTP requests in STDOUT and STDERR.
7+
MULTIAPPS_CONTROLLER_URL=<URL> Overrides the default deploy-service.<system-domain> with a custom URL.
8+
`
9+
const UploadEnvHelpText = BaseEnvHelpText + `
10+
MULTIAPPS_UPLOAD_CHUNK_SIZE=<POSITIVE_INTEGER> Configures chunk size (in MB) for MTAR upload.
11+
MULTIAPPS_UPLOAD_CHUNKS_SEQUENTIALLY=<BOOLEAN> Upload chunks sequentially instead of in parallel. By default is false.
12+
MULTIAPPS_DISABLE_UPLOAD_PROGRESS_BAR=<BOOLEAN> Disable upload progress bar (useful in CI/CD). By default is false.
13+
`

0 commit comments

Comments
 (0)