-
Notifications
You must be signed in to change notification settings - Fork 906
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(provider/oraclebmcs): Add destroy server group stage
- Loading branch information
1 parent
a050ddb
commit b0d538d
Showing
5 changed files
with
122 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
app/scripts/modules/oracle/pipeline/stages/destroyAsg/destroyAsgStage.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div ng-controller="oraclebmcsDestroyAsgStageCtrl as destroyAsgStageCtrl" class="form-horizontal"> | ||
<div ng-if="!pipeline.strategy"> | ||
<account-region-cluster-selector | ||
application="application" | ||
component="stage" | ||
accounts="accounts"> | ||
</account-region-cluster-selector> | ||
</div> | ||
<stage-config-field label="Target"> | ||
<target-select model="stage" options="targets"></target-select> | ||
</stage-config-field> | ||
</div> |
62 changes: 62 additions & 0 deletions
62
app/scripts/modules/oracle/pipeline/stages/destroyAsg/destroyAsgStage.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
'use strict'; | ||
|
||
const angular = require('angular'); | ||
|
||
import { | ||
StageConstants, | ||
PipelineTemplates | ||
} from '@spinnaker/core'; | ||
|
||
module.exports = angular.module('spinnaker.oraclebmcs.pipeline.stage.destroyAsgStage', []) | ||
.config(function(pipelineConfigProvider) { | ||
pipelineConfigProvider.registerStage({ | ||
provides: 'destroyServerGroup', | ||
cloudProvider: 'oraclebmcs', | ||
templateUrl: require('./destroyAsgStage.html'), | ||
executionDetailsUrl: PipelineTemplates.destroyAsgExecutionDetails, | ||
executionStepLabelUrl: require('./destroyAsgStepLabel.html'), | ||
validators: [ | ||
{ | ||
type: 'targetImpedance', | ||
message: 'This pipeline will attempt to destroy a server group without deploying a new version into the same cluster.' | ||
}, | ||
{ type: 'requiredField', fieldName: 'cluster' }, | ||
{ type: 'requiredField', fieldName: 'target', }, | ||
{ type: 'requiredField', fieldName: 'regions', }, | ||
{ type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account'}, | ||
], | ||
}); | ||
}).controller('oraclebmcsDestroyAsgStageCtrl', function($scope, accountService) { | ||
|
||
let stage = $scope.stage; | ||
let provider = 'oraclebmcs'; | ||
|
||
$scope.targets = StageConstants.TARGET_LIST; | ||
stage.regions = stage.regions || []; | ||
stage.cloudProvider = provider; | ||
$scope.state = { | ||
accounts: false, | ||
regionsLoaded: false | ||
}; | ||
|
||
init(); | ||
|
||
function init () { | ||
accountService.listAccounts(provider).then(accounts => { | ||
$scope.accounts = accounts; | ||
$scope.state.accounts = true; | ||
}); | ||
|
||
if (!stage.credentials && $scope.application.defaultCredentials.oraclebmcs) { | ||
stage.credentials = $scope.application.defaultCredentials.oraclebmcs; | ||
} | ||
|
||
if (!stage.regions.length && $scope.application.defaultRegions.oraclebmcs) { | ||
stage.regions.push($scope.application.defaultRegions.oraclebmcs); | ||
} | ||
|
||
if (!stage.target) { | ||
stage.target = $scope.targets[0].val; | ||
} | ||
} | ||
}); |
5 changes: 5 additions & 0 deletions
5
app/scripts/modules/oracle/pipeline/stages/destroyAsg/destroyAsgStepLabel.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<span class="task-label"> | ||
Destroy Server Group: | ||
{{step.context.serverGroupName}} | ||
({{step.context.region}}) | ||
</span> |