diff --git a/app/scripts/modules/oracle/helpContents/oracleHelpContents.ts b/app/scripts/modules/oracle/helpContents/oracleHelpContents.ts index 39d8a96f87c..f5a937caf3a 100644 --- a/app/scripts/modules/oracle/helpContents/oracleHelpContents.ts +++ b/app/scripts/modules/oracle/helpContents/oracleHelpContents.ts @@ -13,7 +13,46 @@ module(ORACLE_HELP_CONTENTS_REGISTRY, [HELP_CONTENTS_REGISTRY]) { key: 'oraclebmcs.serverGroup.detail', value: '(Optional) Detail is a naming component to help distinguish specifics of the server group.' - } + }, + { + key: 'oraclebmcs.pipeline.config.bake.baseOsOption', + value: '

The base operating system from which the image will be created.

' + }, + { + key: 'oraclebmcs.pipeline.config.bake.package', + value: '

The name of the package you want installed (without any version identifiers).

' + + '

For example: curl.

' + }, + { + key: 'oraclebmcs.pipeline.config.bake.upgrade', + value: '

Perform a package manager upgrade before proceeding with the package installation.

' + + '

For example: yum update.

' + }, + { + key: 'oraclebmcs.pipeline.config.bake.regions', + value: '

The region in which the new image will be created.

' + + '

NB: Currently baked images are restricted to a single region.

' + }, + { + key: 'oraclebmcs.pipeline.config.bake.user', + value: '

The name of Oracle BMCS user that will be used during the baking process.

' + }, + { + key: 'oraclebmcs.pipeline.config.bake.account_name', + value: '

The name of Oracle BMCS account that will be used during the baking process.

' + }, + { + key: 'oraclebmcs.pipeline.config.bake.network', + value: '

The name of Oracle BMCS network that will be used during the baking process.

' + }, + { + key: 'oraclebmcs.pipeline.config.bake.availability_domain', + value: '

The Oracle BMCS availability domain that will be used during the baking process.

' + }, + { + key: 'oraclebmcs.pipeline.config.bake.subnet_ocid', + value: '

The the Oracle BMCS subnet that will be used during the baking process.

' + }, ]; helpContents.forEach((entry) => helpContentsRegistry.register(entry.key, entry.value)); diff --git a/app/scripts/modules/oracle/oraclebmcs.module.js b/app/scripts/modules/oracle/oraclebmcs.module.js index 77e940a309a..83d7862cda6 100644 --- a/app/scripts/modules/oracle/oraclebmcs.module.js +++ b/app/scripts/modules/oracle/oraclebmcs.module.js @@ -14,7 +14,10 @@ templates.keys().forEach(function(key) { module.exports = angular.module('spinnaker.oraclebmcs', [ CLOUD_PROVIDER_REGISTRY, ORACLE_HELP_CONTENTS_REGISTRY, + //Cache require('./cache/cacheConfigurer.service.js'), + // Pipeline + require('./pipeline/stages/destroyAsg/destroyAsgStage.js'), // Server Groups require('./serverGroup/serverGroup.transformer.js'), require('./serverGroup/configure/serverGroup.configure.module.js'), diff --git a/app/scripts/modules/oracle/pipeline/stages/destroyAsg/destroyAsgStage.html b/app/scripts/modules/oracle/pipeline/stages/destroyAsg/destroyAsgStage.html new file mode 100644 index 00000000000..1945c764b55 --- /dev/null +++ b/app/scripts/modules/oracle/pipeline/stages/destroyAsg/destroyAsgStage.html @@ -0,0 +1,12 @@ +
+
+ + +
+ + + +
diff --git a/app/scripts/modules/oracle/pipeline/stages/destroyAsg/destroyAsgStage.js b/app/scripts/modules/oracle/pipeline/stages/destroyAsg/destroyAsgStage.js new file mode 100644 index 00000000000..258bf225f59 --- /dev/null +++ b/app/scripts/modules/oracle/pipeline/stages/destroyAsg/destroyAsgStage.js @@ -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; + } + } + }); diff --git a/app/scripts/modules/oracle/pipeline/stages/destroyAsg/destroyAsgStepLabel.html b/app/scripts/modules/oracle/pipeline/stages/destroyAsg/destroyAsgStepLabel.html new file mode 100644 index 00000000000..c9bac9c56ec --- /dev/null +++ b/app/scripts/modules/oracle/pipeline/stages/destroyAsg/destroyAsgStepLabel.html @@ -0,0 +1,5 @@ + + Destroy Server Group: + {{step.context.serverGroupName}} + ({{step.context.region}}) +