Skip to content

Commit

Permalink
feat(core/deploy): Support scaleDown as part of a rolling red/black…
Browse files Browse the repository at this point in the history
… deployment (#6265)
  • Loading branch information
ajordens committed Dec 23, 2018
1 parent f330386 commit 425ca35
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface IRollingRedBlackCommand extends IServerGroupCommand {
pipelineBeforeCleanup: {
application: string;
};
scaleDown: boolean;
targetPercentages: number[] | string;
}

Expand All @@ -30,6 +31,11 @@ export class AdditionalFields extends React.Component<IRollingRedBlackStrategyAd
this.forceUpdate();
};

private scaleDownChange = (e: React.ChangeEvent<HTMLInputElement>) => {
this.props.command.scaleDown = e.target.checked;
this.forceUpdate();
};

public render() {
const { NumberList } = NgReact;
const { command } = this.props;
Expand All @@ -41,6 +47,13 @@ export class AdditionalFields extends React.Component<IRollingRedBlackStrategyAd
Rollback to previous server group if deployment fails <HelpField id="strategy.rollingRedBlack.rollback" />
</label>
</div>
<div className="col-md-12 checkbox">
<label>
<input type="checkbox" checked={command.scaleDown} onChange={this.scaleDownChange} />
Scale down replaced server groups to zero instances <HelpField id="strategy.redblack.scaleDown" />
</label>
</div>

<div className="col-md-6" style={{ marginTop: '5px' }}>
<h4>
Percentages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ DeploymentStrategyRegistry.registerStrategy({
description: `Creates a new version of this server group, then incrementally resizes the new server group while disabling the same percentage in the previous server group.`,
key: 'rollingredblack',
providerRestricted: true,
additionalFields: ['targetPercentages'],
additionalFields: ['targetPercentages', 'scaleDown'],
AdditionalFieldsComponent: AdditionalFields,
initializationMethod: command => {
if (!command.targetPercentages) {
Expand Down

0 comments on commit 425ca35

Please sign in to comment.