MCPcopy Create free account
hub / github.com/cloudfoundry/multiapps-cli-plugin / NewDeploymentStrategy

Function NewDeploymentStrategy

commands/deployment_strategy.go:42–54  ·  view source on GitHub ↗
(flags *flag.FlagSet, typeProvider ProcessTypeProvider)

Source from the content-addressed store, hash-verified

40}
41
42func NewDeploymentStrategy(flags *flag.FlagSet, typeProvider ProcessTypeProvider) DeploymentStrategy {
43 if typeProvider.GetProcessType() == (blueGreenDeployCommandProcessTypeProvider{}).GetProcessType() {
44 return &BlueGreenDeployCommandDeploymentStrategy{GetBoolOpt(noConfirmOpt, flags), GetBoolOpt(skipIdleStart, flags), isIncrementalBlueGreen(flags), GetBoolOpt(shouldBackupPreviousVersionOpt, flags), GetBoolOpt(dependencyAwareStopOrderOpt, flags)}
45 }
46 strategy := GetStringOpt(strategyOpt, flags)
47 if strategy == "default" {
48 return &DeployCommandDeploymentStrategy{}
49 }
50 if GetBoolOpt(skipIdleStart, flags) {
51 return &BlueGreenDeployCommandDeploymentStrategy{true, true, isIncrementalBlueGreen(flags), GetBoolOpt(shouldBackupPreviousVersionOpt, flags), GetBoolOpt(dependencyAwareStopOrderOpt, flags)}
52 }
53 return &BlueGreenDeployCommandDeploymentStrategy{GetBoolOpt(skipTestingPhase, flags), false, isIncrementalBlueGreen(flags), GetBoolOpt(shouldBackupPreviousVersionOpt, flags), GetBoolOpt(dependencyAwareStopOrderOpt, flags)}
54}
55
56func isIncrementalBlueGreen(flags *flag.FlagSet) bool {
57 strategy := GetStringOpt(strategyOpt, flags)

Callers 2

executeInternalMethod · 0.85

Calls 4

GetBoolOptFunction · 0.85
isIncrementalBlueGreenFunction · 0.85
GetStringOptFunction · 0.85
GetProcessTypeMethod · 0.65

Tested by

no test coverage detected