Skip to content

Commit 43e41b9

Browse files
committed
Refactor command and add tests
1 parent 1157320 commit 43e41b9

6 files changed

+405
-157
lines changed

commands/blue_green_deploy_command.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (c *BlueGreenDeployCommand) GetPluginCommand() plugin.Command {
6464
util.GetShortOption(uploadTimeoutOpt): "Upload app timeout in seconds",
6565
util.GetShortOption(taskExecutionTimeoutOpt): "Task execution timeout in seconds",
6666
util.CombineFullAndShortParameters(startTimeoutOpt, timeoutOpt): "Start app timeout in seconds",
67-
util.GetShortOption(shouldPreserveOldApps): "Should preserve old applications (only for blue-green)",
67+
util.GetShortOption(shouldBackupExistingApps): "Should backup existing applications (only for blue-green)",
6868
},
6969
},
7070
}

commands/deploy_command.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const (
5252
applyNamespaceAppRoutesOpt = "apply-namespace-app-routes"
5353
applyNamespaceAsSuffix = "apply-namespace-as-suffix"
5454
maxNamespaceSize = 36
55-
shouldPreserveOldApps = "preserve-old-apps"
55+
shouldBackupExistingApps = "backup-existing-apps"
5656
)
5757

5858
type listFlag struct {
@@ -146,7 +146,7 @@ func (c *DeployCommand) GetPluginCommand() plugin.Command {
146146
util.GetShortOption(uploadTimeoutOpt): "Upload app timeout in seconds",
147147
util.GetShortOption(taskExecutionTimeoutOpt): "Task execution timeout in seconds",
148148
util.CombineFullAndShortParameters(startTimeoutOpt, timeoutOpt): "Start app timeout in seconds",
149-
util.GetShortOption(shouldPreserveOldApps): "Should preserve old applications (only for blue-green)",
149+
util.GetShortOption(shouldBackupExistingApps): "Should backup existing applications (only for blue-green)",
150150
},
151151
},
152152
}
@@ -172,7 +172,7 @@ func deployProcessParametersSetter() ProcessParametersSetter {
172172
processBuilder.Parameter("appsStageTimeout", GetStringOpt(stageTimeoutOpt, flags))
173173
processBuilder.Parameter("appsUploadTimeout", GetStringOpt(uploadTimeoutOpt, flags))
174174
processBuilder.Parameter("appsTaskExecutionTimeout", GetStringOpt(taskExecutionTimeoutOpt, flags))
175-
processBuilder.Parameter("shouldPreserveOldApps", strconv.FormatBool(GetBoolOpt(shouldPreserveOldApps, flags)))
175+
processBuilder.Parameter("shouldBackupExistingApps", strconv.FormatBool(GetBoolOpt(shouldBackupExistingApps, flags)))
176176

177177
var lastSetValue string = ""
178178
for i := 0; i < len(os.Args); i++ {
@@ -226,7 +226,7 @@ func (c *DeployCommand) defineCommandOptions(flags *flag.FlagSet) {
226226
flags.String(stageTimeoutOpt, "", "")
227227
flags.String(uploadTimeoutOpt, "", "")
228228
flags.String(taskExecutionTimeoutOpt, "", "")
229-
flags.Bool(shouldPreserveOldApps, false, "")
229+
flags.Bool(shouldBackupExistingApps, false, "")
230230
}
231231

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

commands/revert_deploy_command.go

-151
This file was deleted.

0 commit comments

Comments
 (0)