(flags *flag.FlagSet, typeProvider ProcessTypeProvider)
| 40 | } |
| 41 | |
| 42 | func 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 | |
| 56 | func isIncrementalBlueGreen(flags *flag.FlagSet) bool { |
| 57 | strategy := GetStringOpt(strategyOpt, flags) |
no test coverage detected