Skip to content

Commit c48a684

Browse files
MNoevaboyan-velinov
authored andcommitted
Added new 4 parameters for timeout
1 parent d174d53 commit c48a684

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

commands/blue_green_deploy_command.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,13 @@ func (c *BlueGreenDeployCommand) GetPluginCommand() plugin.Command {
3333
HelpText: "Deploy a multi-target app using blue-green deployment",
3434
UsageDetails: plugin.Usage{
3535
Usage: `Deploy a multi-target app using blue-green deployment
36-
cf bg-deploy MTA [-e EXT_DESCRIPTOR[,...]] [-t TIMEOUT] [--version-rule VERSION_RULE] [-u URL] [-f] [--retries RETRIES] [--no-start] [--namespace NAMESPACE] [--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]
36+
cf bg-deploy MTA [-e EXT_DESCRIPTOR[,...]] [--version-rule VERSION_RULE] [-u URL] [-f] [--retries RETRIES] [--no-start] [--namespace NAMESPACE] [--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] [--task-execution-timeout TIMEOUT]
3737
3838
Perform action on an active deploy operation
3939
cf deploy -i OPERATION_ID -a ACTION [-u URL]`,
4040
Options: map[string]string{
4141
extDescriptorsOpt: "Extension descriptors",
4242
deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.<system-domain>'",
43-
timeoutOpt: "Start timeout in seconds",
4443
versionRuleOpt: "Version rule (HIGHER, SAME_HIGHER, ALL)",
4544
operationIDOpt: "Active deploy operation ID",
4645
actionOpt: "Action to perform on active deploy operation (abort, retry, resume, monitor)",
@@ -57,6 +56,10 @@ func (c *BlueGreenDeployCommand) GetPluginCommand() plugin.Command {
5756
util.GetShortOption(abortOnErrorOpt): "Auto-abort the process on any errors",
5857
util.GetShortOption(retriesOpt): "Retry the operation N times in case a non-content error occurs (default 3)",
5958
util.GetShortOption(skipIdleStart): "Directly start the new MTA version as 'live', skipping the 'idle' phase of the resources. Do not require further confirmation or testing before deleting the old version",
59+
util.GetShortOption(startTimeoutOpt): "Start app timeout in seconds",
60+
util.GetShortOption(stageTimeoutOpt): "Stage app timeout in seconds",
61+
util.GetShortOption(uploadTimeoutOpt): "Upload app timeout in seconds",
62+
util.GetShortOption(taskExecutionTimeoutOpt): "Task execution timeout in seconds",
6063
},
6164
},
6265
}

commands/deploy_command.go

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030

3131
const (
3232
extDescriptorsOpt = "e"
33-
timeoutOpt = "t"
3433
versionRuleOpt = "version-rule"
3534
noStartOpt = "no-start"
3635
deleteServiceKeysOpt = "delete-service-keys"
@@ -43,6 +42,10 @@ const (
4342
strategyOpt = "strategy"
4443
skipTestingPhase = "skip-testing-phase"
4544
skipIdleStart = "skip-idle-start"
45+
startTimeoutOpt = "apps-start-timeout"
46+
stageTimeoutOpt = "apps-stage-timeout"
47+
uploadTimeoutOpt = "apps-upload-timeout"
48+
taskExecutionTimeoutOpt = "task-execution-timeout"
4649
)
4750

4851
type listFlag struct {
@@ -94,17 +97,17 @@ func (c *DeployCommand) GetPluginCommand() plugin.Command {
9497
HelpText: "Deploy a new multi-target app or sync changes to an existing one",
9598
UsageDetails: plugin.Usage{
9699
Usage: `Deploy a multi-target app archive
97-
cf deploy MTA [-e EXT_DESCRIPTOR[,...]] [-t TIMEOUT] [--version-rule VERSION_RULE] [-u URL] [-f] [--retries RETRIES] [--no-start] [--namespace NAMESPACE] [--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]
100+
cf deploy MTA [-e EXT_DESCRIPTOR[,...]] [--version-rule VERSION_RULE] [-u URL] [-f] [--retries RETRIES] [--no-start] [--namespace NAMESPACE] [--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] [--task-execution-timeout TIMEOUT]
98101
99102
Perform action on an active deploy operation
100103
cf deploy -i OPERATION_ID -a ACTION [-u URL]
101104
102105
(EXPERIMENTAL) Deploy a multi-target app archive referenced by a remote URL
103-
<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] [--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]`,
106+
<write MTA archive URL to STDOUT> | cf deploy [-e EXT_DESCRIPTOR[,...]] [--version-rule VERSION_RULE] [-u MTA_CONTROLLER_URL] [--retries RETRIES] [--no-start] [--namespace NAMESPACE] [--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] [--task-execution-timeout TIMEOUT]`,
104107
Options: map[string]string{
105108
extDescriptorsOpt: "Extension descriptors",
106109
deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.<system-domain>'",
107-
timeoutOpt: "Start timeout in seconds",
110+
108111
versionRuleOpt: "Version rule (HIGHER, SAME_HIGHER, ALL)",
109112
operationIDOpt: "Active deploy operation ID",
110113
actionOpt: "Action to perform on active deploy operation (abort, retry, resume, monitor)",
@@ -126,6 +129,13 @@ func (c *DeployCommand) GetPluginCommand() plugin.Command {
126129
util.GetShortOption(strategyOpt): "Specify the deployment strategy when updating an mta (default, blue-green, (EXPERIMENTAL) incremental-blue-green)",
127130
util.GetShortOption(skipTestingPhase): "(STRATEGY: BLUE-GREEN, (EXPERIMENTAL) INCREMENTAL-BLUE-GREEN) Do not require confirmation for deleting the previously deployed MTA app",
128131
util.GetShortOption(skipIdleStart): "(STRATEGY: BLUE-GREEN, (EXPERIMENTAL) INCREMENTAL-BLUE-GREEN) Directly start the new MTA version as 'live', skipping the 'idle' phase of the resources. Do not require further confirmation or testing before deleting the old version",
132+
util.GetShortOption(strategyOpt): "Specify the deployment strategy when updating an mta (default, blue-green)",
133+
util.GetShortOption(skipTestingPhase): "(STRATEGY: BLUE-GREEN) Do not require confirmation for deleting the previously deployed MTA app",
134+
util.GetShortOption(skipIdleStart): "(STRATEGY: BLUE-GREEN) Directly start the new MTA version as 'live', skipping the 'idle' phase of the resources. Do not require further confirmation or testing before deleting the old version",
135+
util.GetShortOption(startTimeoutOpt): "Start app timeout in seconds",
136+
util.GetShortOption(stageTimeoutOpt): "Stage app timeout in seconds",
137+
util.GetShortOption(uploadTimeoutOpt): "Upload app timeout in seconds",
138+
util.GetShortOption(taskExecutionTimeoutOpt): "Task execution timeout in seconds",
129139
},
130140
},
131141
}
@@ -142,13 +152,17 @@ func deployProcessParametersSetter() ProcessParametersSetter {
142152
processBuilder.Parameter("deleteServices", strconv.FormatBool(GetBoolOpt(deleteServicesOpt, flags)))
143153
processBuilder.Parameter("noStart", strconv.FormatBool(GetBoolOpt(noStartOpt, flags)))
144154
processBuilder.Parameter("deleteServiceBrokers", strconv.FormatBool(GetBoolOpt(deleteServiceBrokersOpt, flags)))
145-
processBuilder.Parameter("startTimeout", GetStringOpt(timeoutOpt, flags))
146155
processBuilder.Parameter("versionRule", GetStringOpt(versionRuleOpt, flags))
147156
processBuilder.Parameter("keepFiles", strconv.FormatBool(GetBoolOpt(keepFilesOpt, flags)))
148157
processBuilder.Parameter("noRestartSubscribedApps", strconv.FormatBool(GetBoolOpt(noRestartSubscribedAppsOpt, flags)))
149158
processBuilder.Parameter("noFailOnMissingPermissions", strconv.FormatBool(GetBoolOpt(noFailOnMissingPermissionsOpt, flags)))
150159
processBuilder.Parameter("abortOnError", strconv.FormatBool(GetBoolOpt(abortOnErrorOpt, flags)))
151160
processBuilder.Parameter("skipOwnershipValidation", strconv.FormatBool(GetBoolOpt(skipOwnershipValidationOpt, flags)))
161+
processBuilder.Parameter("appsStartTimeout", GetStringOpt(startTimeoutOpt, flags))
162+
processBuilder.Parameter("appsStageTimeout", GetStringOpt(stageTimeoutOpt, flags))
163+
processBuilder.Parameter("appsUploadTimeout", GetStringOpt(uploadTimeoutOpt, flags))
164+
processBuilder.Parameter("taskExecutionTimeout", GetStringOpt(taskExecutionTimeoutOpt, flags))
165+
152166
}
153167
}
154168

@@ -157,7 +171,6 @@ func (c *DeployCommand) defineCommandOptions(flags *flag.FlagSet) {
157171
flags.String(operationIDOpt, "", "")
158172
flags.String(actionOpt, "", "")
159173
flags.Bool(forceOpt, false, "")
160-
flags.String(timeoutOpt, "", "")
161174
flags.String(versionRuleOpt, "", "")
162175
flags.Bool(deleteServicesOpt, false, "")
163176
flags.Bool(noStartOpt, false, "")
@@ -177,6 +190,10 @@ func (c *DeployCommand) defineCommandOptions(flags *flag.FlagSet) {
177190
flags.Bool(skipIdleStart, false, "")
178191
flags.Var(&modulesList, moduleOpt, "")
179192
flags.Var(&resourcesList, resourceOpt, "")
193+
flags.String(startTimeoutOpt, "", "")
194+
flags.String(stageTimeoutOpt, "", "")
195+
flags.String(uploadTimeoutOpt, "", "")
196+
flags.String(taskExecutionTimeoutOpt, "", "")
180197
}
181198

182199
func (c *DeployCommand) executeInternal(positionalArgs []string, dsHost string, flags *flag.FlagSet, cfTarget util.CloudFoundryTarget) ExecutionStatus {

0 commit comments

Comments
 (0)