@spinnaker/docker
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -1,2 +0,2 @@ | ||
!function(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory(require("@spinnaker/core")):"function"==typeof define&&define.amd?define("@spinnaker/docker",["@spinnaker/core"],factory):"object"==typeof exports?exports["@spinnaker/docker"]=factory(require("@spinnaker/core")):root["@spinnaker/docker"]=factory(root["@spinnaker/core"])}(window,function(__WEBPACK_EXTERNAL_MODULE__1__){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.r=function(exports){Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=21)}([function(module,exports){module.exports=require("angular")},function(module,exports){module.exports=__WEBPACK_EXTERNAL_MODULE__1__},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const core_1=__webpack_require__(1);exports.DockerImageReader=class{static getImage(imageName,region,credentials){return core_1.API.all("images").one(credentials).one(region).one(imageName).withParams({provider:"docker"}).get().then(results=>results&&results.length?results[0]:null).catch(()=>null)}static findImages(params){return core_1.RetryService.buildRetrySequence(()=>core_1.API.all("images/find").getList(params),results=>results.length>0,10,1e3).then(results=>results).catch(()=>[])}static findTags(params){return core_1.RetryService.buildRetrySequence(()=>core_1.API.all("images/tags").getList(params),results=>results.length>0,10,1e3).then(results=>results).catch(()=>[])}}},function(module,exports){var path="docker/src/pipeline/trigger/dockerTrigger.html";window.angular.module("ng").run(["$templateCache",function(c){c.put(path,'<ng-form name="dockerForm">\n <docker-image-and-tag-selector\n specify-tag-by-regex="true"\n account="trigger.account"\n organization="trigger.organization"\n registry="trigger.registry"\n repository="trigger.repository"\n tag="trigger.tag"\n show-registry="true"\n on-change="ctrl.onChange"></docker-image-and-tag-selector>\n\n <div class="form-group" ng-if="vm.fiatEnabled">\n <run-as-user-selector service-accounts="vm.serviceAccounts"\n component="vm.trigger"\n field="runAsUser">\n </run-as-user-selector>\n </div>\n</ng-form>\n')}]),module.exports=path},function(module,exports){var path="docker/src/pipeline/stages/bake/bakeStage.html";window.angular.module("ng").run(["$templateCache",function(c){c.put(path,'<div ng-controller="dockerBakeStageCtrl as bakeStageCtrl">\n <stage-config-field label="Package" help-key="pipeline.config.bake.package">\n <input type="text" class="form-control input-sm"\n ng-model="stage.package"/>\n </stage-config-field>\n <stage-config-field label="Organization" help-key="pipeline.config.docker.bake.organization">\n <input type="text" class="form-control input-sm"\n ng-model="stage.organization"/>\n </stage-config-field>\n <stage-config-field label="Image Name" help-key="pipeline.config.docker.bake.targetImage">\n <input type="text" class="form-control input-sm"\n ng-model="stage.ami_name"/>\n </stage-config-field>\n <stage-config-field label="Image tag" help-key="pipeline.config.docker.bake.targetImageTag">\n <input type="text" class="form-control input-sm"\n ng-model="stage.extendedAttributes[\'docker_target_image_tag\']"/>\n </stage-config-field>\n <stage-config-field label="Base OS">\n <bake-stage-choose-os model="stage.baseOs" base-os-options="baseOsOptions"></bake-stage-choose-os>\n </stage-config-field>\n\n <stage-config-field label="Base Label">\n <label class="radio-inline" ng-repeat="baseLabel in baseLabelOptions">\n <input type="radio"\n ng-model="stage.baseLabel"\n ng-value="baseLabel"/>\n {{baseLabel}}\n </label>\n </stage-config-field>\n <stage-config-field label="Rebake">\n <div class="checkbox" style="margin-bottom: 0">\n <label>\n <input type="checkbox"\n ng-model="stage.rebake">\n </input>\n Rebake image without regard to the status of any existing bake\n </label>\n </div>\n </stage-config-field>\n</div>\n')}]),module.exports=path},function(module,exports){var path="docker/src/pipeline/stages/bake/bakeExecutionDetails.html";window.angular.module("ng").run(["$templateCache",function(c){c.put(path,'<div ng-controller="dockerBakeExecutionDetailsCtrl">\n <execution-details-section-nav sections="configSections"></execution-details-section-nav>\n <div class="step-section-details" ng-if="detailsSection === \'bakeConfig\'">\n <div class="row">\n <div class="col-md-6">\n <dl class="dl-narrow dl-horizontal">\n <dt if-multiple-providers>Provider</dt>\n <dd if-multiple-providers>Docker</dd>\n <dt>Organization</dt>\n <dd>{{stage.context.organization}}</dd>\n <dt>Image Name</dt>\n <dd>{{stage.context.ami_name}}</dd>\n <dt>Image Tag</dt>\n <dd>{{stage.context.extendedAttributes[\'docker_target_image_tag\']}}</dd>\n <dt>Image</dt>\n <dd>{{stage.context.ami}}</dd>\n </dl>\n </div>\n <div class="col-md-6">\n <dl class="dl-narrow dl-horizontal">\n <dt>Base OS</dt>\n <dd>{{stage.context.baseOs}}</dd>\n <dt>Region</dt>\n <dd>{{stage.context.region}}</dd>\n <dt>Package</dt>\n <dd>{{stage.context.package}}</dd>\n <dt>Label</dt>\n <dd>{{stage.context.baseLabel}}</dd>\n </dl>\n </div>\n </div>\n <stage-failure-message stage="stage" message="stage.failureMessage"></stage-failure-message>\n\n <div class="row" ng-if="stage.context.region && stage.context.status.resourceId">\n <div class="col-md-12">\n <div class="alert alert-{{stage.isFailed ? \'danger\' : \'info\'}}">\n <a target="_blank" href="{{ bakeryDetailUrl(stage) }}">\n View Bakery Details\n </a>\n </div>\n </div>\n </div>\n\n </div>\n <div class="step-section-details" ng-if="detailsSection === \'taskStatus\'">\n <div class="row">\n <execution-step-details item="stage"></execution-step-details>\n </div>\n </div>\n</div>\n')}]),module.exports=path},function(module,exports){var path="docker/src/image/dockerImageAndTagSelector.component.html";window.angular.module("ng").run(["$templateCache",function(c){c.put(path,'<div class="form-group" ng-if="$ctrl.showRegistry">\n <div ng-class="$ctrl.labelClass" class="sm-label-right">\n Registry Name\n </div>\n <div ng-class="$ctrl.fieldClass">\n <ui-select ng-model="$ctrl.account"\n ng-disabled="$ctrl.viewState.imagesRefreshing"\n ng-change="$ctrl.changeAccount()"\n class="form-control input-sm">\n <ui-select-match>{{$ctrl.account}}</ui-select-match>\n <ui-select-choices repeat="account in $ctrl.accounts | filter: $select.search | orderBy">\n <span ng-bind-html="account | highlight: $select.search"></span>\n </ui-select-choices>\n </ui-select>\n </div>\n <div class="col-md-1 text-center">\n <a href\n ng-click="$ctrl.refreshImages()"\n tooltip-placement="right"\n uib-tooltip="{{$ctrl.viewState.imagesRefreshing ? \'Images refreshing.\' : \'Refresh images list\' }}">\n <span ng-class="{\'fa-spin\':$ctrl.viewState.imagesRefreshing}"\n class="fa fa-sync-alt"></span>\n </a>\n </div>\n</div>\n<div class="form-group">\n <div ng-class="$ctrl.labelClass" class="sm-label-right">\n Organization\n </div>\n <div ng-class="$ctrl.fieldClass">\n <input class="form-control input-sm"\n ng-if="$ctrl.organization.includes(\'${\')"\n ng-model="$ctrl.organization"/>\n <ui-select ng-model="$ctrl.organization"\n ng-if="!$ctrl.organization.includes(\'${\')"\n ng-disabled="$ctrl.viewState.imagesRefreshing"\n ng-change="$ctrl.updateRepositoryList()" class="form-control input-sm">\n <ui-select-match placeholder="No organization">{{$ctrl.organization}}</ui-select-match>\n <ui-select-choices repeat="organization in $ctrl.organizations | filter: $select.search | orderBy">\n <span ng-bind-html="organization || \'No organization\' | highlight: $select.search"></span>\n </ui-select-choices>\n </ui-select>\n </div>\n</div>\n<div class="form-group">\n <div ng-class="$ctrl.labelClass" class="sm-label-right">\n Image\n </div>\n <div ng-class="$ctrl.fieldClass">\n <input class="form-control input-sm"\n ng-if="$ctrl.repository.includes(\'${\')"\n ng-model="$ctrl.repository"/>\n <ui-select ng-model="$ctrl.repository"\n ng-if="!$ctrl.repository.includes(\'${\')"\n ng-disabled="$ctrl.viewState.imagesRefreshing"\n ng-change="$ctrl.updateTag()"\n class="form-control input-sm"\n required>\n <ui-select-match>{{$ctrl.repository}}</ui-select-match>\n <ui-select-choices repeat="repository in $ctrl.repositories | filter: $select.search | orderBy">\n <span ng-bind-html="repository | highlight: $select.search"></span>\n </ui-select-choices>\n </ui-select>\n </div>\n</div>\n<div class="form-group" ng-if="$ctrl.specifyTagByRegex">\n <div ng-class="$ctrl.labelClass" class="sm-label-right">\n Tag\n <help-field key="pipeline.config.docker.trigger.tag"></help-field>\n </div>\n <div ng-class="$ctrl.fieldClass">\n <input type="text"\n class="form-control input-sm"\n ng-model="$ctrl.tag"\n ng-disabled="$ctrl.viewState.imagesRefreshing || !$ctrl.repository"\n ng-change="$ctrl.updateTag()"/>\n </div>\n</div>\n<div class="form-group" ng-if="!$ctrl.specifyTagByRegex">\n <div ng-class="$ctrl.labelClass" class="sm-label-right">\n Tag\n </div>\n <div ng-class="$ctrl.fieldClass">\n <input class="form-control input-sm"\n ng-if="$ctrl.tag.includes(\'${\')"\n ng-model="$ctrl.tag"/>\n <ui-select ng-model="$ctrl.tag"\n ng-if="!$ctrl.tag.includes(\'${\')"\n ng-disabled="$ctrl.viewState.imagesRefreshing || !$ctrl.repository"\n ng-change="$ctrl.updateTag()"\n class="form-control input-sm"\n required>\n <ui-select-match placeholder="No tag">{{$ctrl.tag}}</ui-select-match>\n <ui-select-choices repeat="tag in $ctrl.tags | filter: $select.search | orderBy">\n <span ng-bind-html="tag || \'No tag\' | highlight: $select.search"></span>\n </ui-select-choices>\n </ui-select>\n </div>\n</div>\n')}]),module.exports=path},function(module,exports){module.exports=require("lodash")},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const angular_1=__webpack_require__(0),lodash_1=__webpack_require__(7),core_1=__webpack_require__(1),DockerImageReader_1=__webpack_require__(2);class DockerImageAndTagSelectorController{constructor(){this.viewState={imagesLoading:!1,imagesLoaded:!1,imagesRefreshing:!1},this.organizations=[]}updateOrganizationsList(){this.accountMap&&(this.showRegistry&&(this.registry=this.registryMap[this.account],this.onChange&&this.onChange({registry:this.registry})),this.organizations=this.accountMap[this.showRegistry?this.account:this.registry]||[],this.organizations.includes(this.organization)||!this.organization||this.organization.includes("${")||(this.organization=null),this.updateRepositoryList())}updateRepositoryList(){if(this.organizationMap){const key=`${this.showRegistry?this.account:this.registry}/${this.organization||""}`;this.repositories=this.organizationMap[key]||[],this.repositories.includes(this.repository)||!this.repository||this.repository.includes("${")||(this.repository=null),this.updateTag()}}updateTag(){if(this.specifyTagByRegex)""===lodash_1.trim(this.tag)&&this.tag&&(this.tag=null);else if(this.repositoryMap){const key=this.repository;this.tags=this.repositoryMap[key]||[],this.tags.includes(this.tag)||!this.tag||this.tag.includes("${")||(this.tag=null)}}updateRegistryMap(images){this.registryMap=images.reduce((map,image)=>(map[image.account]=image.registry,map),{})}updateAccountMap(images){const results=images.reduce((map,image)=>{const key=image.account;if(!key)return map;const parts=image.repository.split("/");parts.pop();const org=parts.join("/");return map[key]||(map[key]=[]),map[key].push(org),map},{});this.uniqMapEntries(results),this.accountMap=results}updateOrganizationMap(images){const results=images.reduce((map,image)=>{if(!image.repository)return map;const parts=image.repository.split("/");parts.pop();const key=`${image.account}/${parts.join("/")}`;return map[key]||(map[key]=[]),map[key].push(image.repository),map},{});this.uniqMapEntries(results),this.organizationMap=results}updateRepositoryMap(images){const results=images.reduce((map,image)=>{if(!image.repository)return map;const key=image.repository;return map[key]||(map[key]=[]),map[key].push(image.tag),map},{});this.uniqMapEntries(results),this.repositoryMap=results}initializeAccounts(){core_1.AccountService.listAccounts("dockerRegistry").then(accounts=>{this.accounts=accounts.map(account=>account.name),this.showRegistry&&!this.account&&(this.account=this.accounts[0]),this.refreshImages()})}initializeImages(){const imageConfig={provider:"dockerRegistry",account:this.showRegistry?this.account:this.registry};this.viewState.imagesLoading=!0;const imageLoader=DockerImageReader_1.DockerImageReader.findImages(imageConfig).then(images=>{this.imageLoader===imageLoader&&(this.updateRegistryMap(images),this.updateAccountMap(images),this.accounts=this.accounts||Object.keys(this.accountMap),this.updateOrganizationMap(images),this.organizations.push(...Object.keys(this.organizationMap)),this.updateRepositoryMap(images),this.updateOrganizationsList(),this.viewState.imagesLoaded=!0)}).finally(()=>{this.viewState.imagesLoading=!1,this.viewState.imagesRefreshing=!1});this.imageLoader=imageLoader}uniqMapEntries(map){Object.keys(map).forEach(k=>{map[k]=lodash_1.uniq(map[k])})}isNew(){return!(this.account||this.organization||this.registry||this.repository||this.tag)}refreshImages(){this.viewState.imagesRefreshing=!0,this.initializeImages()}changeAccount(){this.organization=this.repository=this.tag=null,this.initializeImages()}$onInit(){this.labelClass=this.labelClass||"col-md-3",this.fieldClass=this.fieldClass||"col-md-8",this.deferInitialization||!this.registry&&!this.isNew()||this.initializeAccounts()}$onChanges(changes){this.deferInitialization&&changes.registry&&lodash_1.isString(changes.registry.currentValue)&&this.initializeAccounts()}}exports.DockerImageAndTagSelectorController=DockerImageAndTagSelectorController;exports.DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT="spinnaker.docker.imageAndTagSelector.component",angular_1.module(exports.DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT,[]).component("dockerImageAndTagSelector",new class{constructor(){this.bindings={specifyTagByRegex:"=",organization:"=",registry:"<",repository:"=",tag:"=",account:"=",showRegistry:"<?",labelClass:"@?",fieldClass:"@?",onChange:"=?",deferInitialization:"=?"},this.controller=DockerImageAndTagSelectorController,this.templateUrl=__webpack_require__(6)}})},function(module,exports){module.exports=require("rxjs")},function(module,exports){module.exports=require("ngimport")},function(module,exports){module.exports=require("react")},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const React=__webpack_require__(11),ngimport_1=__webpack_require__(10),rxjs_1=__webpack_require__(9),core_1=__webpack_require__(1),DockerImageReader_1=__webpack_require__(2);exports.DockerTriggerTemplate=class extends React.Component{constructor(props){super(props),this.queryStream=new rxjs_1.Subject,this.handleQuery=(()=>{const trigger=this.props.command.trigger;return rxjs_1.Observable.fromPromise(DockerImageReader_1.DockerImageReader.findTags({provider:"dockerRegistry",account:trigger.account,repository:trigger.repository}))}),this.updateSelectedTag=(tag=>{const{command:command}=this.props,trigger=command.trigger;if(command.extraFields.tag=tag,trigger&&trigger.repository){let imageName="";trigger.registry&&(imageName+=trigger.registry+"/"),imageName+=trigger.repository,command.extraFields.artifacts=[{type:"docker/image",name:imageName,version:tag,reference:imageName+":"+tag}]}this.setState({selectedTag:tag})}),this.tagLoadSuccess=(tags=>{const{command:command}=this.props,trigger=command.trigger,newState={};if(newState.tags=tags,newState.tags.length){const defaultSelection=newState.tags.find(t=>t===trigger.tag)||newState.tags[0];newState.selectedTag=defaultSelection,this.updateSelectedTag(defaultSelection)}newState.tagsLoading=!1,this.setState(newState)}),this.tagLoadFailure=(()=>{this.setState({tagsLoading:!1,loadError:!0})}),this.initialize=(()=>{const{command:command}=this.props;this.subscription=this.queryStream.debounceTime(250).switchMap(this.handleQuery).subscribe(this.tagLoadSuccess,this.tagLoadFailure),command.extraFields={},"docker"===command.trigger.type?this.searchTags():this.subscription.unsubscribe()}),this.searchTags=((query="")=>{this.setState({tags:[`<span>Finding tags${query&&` matching ${query}`}...</span>`]}),this.queryStream.next()}),this.state={tags:[],tagsLoading:!0,loadError:!1,selectedTag:""}}static formatLabel(trigger){return ngimport_1.$q.when(`(Docker Registry) ${trigger.account?trigger.account+":":""} ${trigger.repository||""}`)}componentWillReceiveProps(nextProps){nextProps.command!==this.props.command&&this.initialize()}componentDidMount(){this.initialize()}render(){const{tags:tags,tagsLoading:tagsLoading,loadError:loadError,selectedTag:selectedTag}=this.state,options=tags.map(tag=>({value:tag}));return React.createElement("div",{className:"form-group"},React.createElement("label",{className:"col-md-4 sm-label-right"},"Tag"),tagsLoading&&React.createElement("div",{className:"col-md-6"},React.createElement("div",{className:"form-control-static text-center"},React.createElement(core_1.Spinner,{size:"small"}))),React.createElement("input",{type:"hidden",required:tagsLoading,value:selectedTag}),loadError&&React.createElement("div",{className:"col-md-6"},"Error loading tags!"),!tagsLoading&&React.createElement("div",{className:"col-md-6"},0===tags.length&&React.createElement("div",null,React.createElement("p",{className:"form-control-static"},"No tags found")),tags.length>0&&React.createElement(core_1.TetheredSelect,{options:options,optionRenderer:o=>React.createElement("span",null,o.value),clearable:!1,value:selectedTag,valueRenderer:o=>React.createElement("span",null,React.createElement("strong",null,o.value)),onChange:o=>this.updateSelectedTag(o.value)})))}}},function(module,exports,__webpack_require__){"use strict";var _core=__webpack_require__(1),_dockerImageAndTagSelector=__webpack_require__(8),_DockerTriggerTemplate=__webpack_require__(12);const angular=__webpack_require__(0);module.exports=angular.module("spinnaker.docker.pipeline.trigger",[_core.SERVICE_ACCOUNT_SERVICE,_dockerImageAndTagSelector.DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT]).config(["pipelineConfigProvider",function(pipelineConfigProvider){pipelineConfigProvider.registerTrigger({label:"Docker Registry",description:"Executes the pipeline on an image update",key:"docker",controller:"DockerTriggerCtrl as ctrl",controllerAs:"vm",templateUrl:__webpack_require__(3),manualExecutionComponent:_DockerTriggerTemplate.DockerTriggerTemplate,validators:[{type:"requiredField",fieldName:"account",message:"<strong>Registry</strong> is a required field for Docker Registry triggers."},{type:"requiredField",fieldName:"repository",message:"<strong>Image</strong> is a required field for Docker Registry triggers."},{type:"serviceAccountAccess",preventSave:!0,message:"You do not have access to the service account configured in this pipeline's Docker Registry trigger.\n You will not be able to save your edits to this pipeline."}]})}]).controller("DockerTriggerCtrl",["trigger","serviceAccountService",function(trigger,serviceAccountService){this.trigger=trigger,this.fiatEnabled=_core.SETTINGS.feature.fiatEnabled,serviceAccountService.getServiceAccounts().then(accounts=>{this.serviceAccounts=accounts||[]}),this.onChange=(changes=>{this.trigger.registry=changes.registry})}])},function(module,exports){module.exports=require("@uirouter/angularjs")},function(module,exports,__webpack_require__){"use strict";var _core=__webpack_require__(1);const angular=__webpack_require__(0);module.exports=angular.module("spinnaker.docker.pipeline.stage.bake.executionDetails.controller",[__webpack_require__(14).default]).controller("dockerBakeExecutionDetailsCtrl",["$scope","$stateParams","executionDetailsSectionService","$interpolate",function($scope,$stateParams,executionDetailsSectionService,$interpolate){$scope.configSections=["bakeConfig","taskStatus"];let initialized=()=>{$scope.detailsSection=$stateParams.details,$scope.provider=$scope.stage.context.cloudProviderType||"docker",$scope.bakeryDetailUrl=$interpolate(_core.SETTINGS.bakeryDetailUrl)},initialize=()=>executionDetailsSectionService.synchronizeSection($scope.configSections,initialized);initialize(),$scope.$on("$stateChangeSuccess",initialize)}])},function(module,exports,__webpack_require__){"use strict";var obj,_lodash=__webpack_require__(7),_lodash2=(obj=_lodash)&&obj.__esModule?obj:{default:obj},_core=__webpack_require__(1);const angular=__webpack_require__(0);module.exports=angular.module("spinnaker.docker.pipeline.stage.bakeStage",[_core.PIPELINE_CONFIG_PROVIDER,__webpack_require__(15).name,_core.BAKERY_SERVICE]).config(["pipelineConfigProvider",function(pipelineConfigProvider){pipelineConfigProvider.registerStage({provides:"bake",cloudProvider:"docker",label:"Bake",description:"Bakes an image in the specified region",templateUrl:__webpack_require__(4),executionDetailsUrl:__webpack_require__(5),executionLabelComponent:_core.BakeExecutionLabel,extraLabelLines:stage=>stage.masterStage.context.allPreviouslyBaked||stage.masterStage.context.somePreviouslyBaked?1:0,defaultTimeoutMs:36e5,validators:[{type:"requiredField",fieldName:"package"}],restartable:!0})}]).controller("dockerBakeStageCtrl",["$scope","bakeryService","$q",function($scope,bakeryService,$q){$scope.stage.region="global",$scope.stage.user||($scope.stage.user=_core.AuthenticationService.getAuthenticatedUser().name),$scope.viewState={loading:!0},$scope.$watch("stage",function(){_lodash2.default.forOwn($scope.stage,function(val,key){""===val&&delete $scope.stage[key]})},!0),$scope.viewState.providerSelected=!0,$q.all({baseOsOptions:bakeryService.getBaseOsOptions("docker"),baseLabelOptions:bakeryService.getBaseLabelOptions()}).then(function(results){$scope.baseOsOptions=results.baseOsOptions.baseImages,$scope.baseLabelOptions=results.baseLabelOptions,!$scope.stage.baseOs&&$scope.baseOsOptions&&$scope.baseOsOptions.length&&($scope.stage.baseOs=$scope.baseOsOptions[0].id),!$scope.stage.baseLabel&&$scope.baseLabelOptions&&$scope.baseLabelOptions.length&&($scope.stage.baseLabel=$scope.baseLabelOptions[0]),$scope.viewState.loading=!1})}])},function(module,exports,__webpack_require__){var map={"./image/dockerImageAndTagSelector.component.html":6,"./pipeline/stages/bake/bakeExecutionDetails.html":5,"./pipeline/stages/bake/bakeStage.html":4,"./pipeline/trigger/dockerTrigger.html":3};function webpackContext(req){var id=webpackContextResolve(req);return __webpack_require__(id)}function webpackContextResolve(req){var id=map[req];if(!(id+1)){var e=new Error('Cannot find module "'+req+'".');throw e.code="MODULE_NOT_FOUND",e}return id}webpackContext.keys=function(){return Object.keys(map)},webpackContext.resolve=webpackContextResolve,module.exports=webpackContext,webpackContext.id=17},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const angular_1=__webpack_require__(0),dockerImageAndTagSelector_component_1=__webpack_require__(8);exports.IMAGE_MODULE="spinnaker.docker.image",angular_1.module(exports.IMAGE_MODULE,[dockerImageAndTagSelector_component_1.DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT])},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const angular_1=__webpack_require__(0),image_module_1=__webpack_require__(18),templates=__webpack_require__(17);templates.keys().forEach(function(key){templates(key)}),exports.DOCKER_MODULE="spinnaker.docker",angular_1.module(exports.DOCKER_MODULE,[__webpack_require__(16).name,__webpack_require__(13).name,image_module_1.IMAGE_MODULE])},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(m){for(var p in m)exports.hasOwnProperty(p)||(exports[p]=m[p])}(__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";function __export(m){for(var p in m)exports.hasOwnProperty(p)||(exports[p]=m[p])}Object.defineProperty(exports,"__esModule",{value:!0}),__export(__webpack_require__(20)),__export(__webpack_require__(19))}])}); | ||
!function(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory(require("@spinnaker/core")):"function"==typeof define&&define.amd?define("@spinnaker/docker",["@spinnaker/core"],factory):"object"==typeof exports?exports["@spinnaker/docker"]=factory(require("@spinnaker/core")):root["@spinnaker/docker"]=factory(root["@spinnaker/core"])}(window,function(__WEBPACK_EXTERNAL_MODULE__1__){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.r=function(exports){Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=21)}([function(module,exports){module.exports=require("angular")},function(module,exports){module.exports=__WEBPACK_EXTERNAL_MODULE__1__},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const core_1=__webpack_require__(1);exports.DockerImageReader=class{static getImage(imageName,region,credentials){return core_1.API.all("images").one(credentials).one(region).one(imageName).withParams({provider:"docker"}).get().then(results=>results&&results.length?results[0]:null).catch(()=>null)}static findImages(params){return core_1.RetryService.buildRetrySequence(()=>core_1.API.all("images/find").getList(params),results=>results.length>0,10,1e3).then(results=>results).catch(()=>[])}static findTags(params){return core_1.RetryService.buildRetrySequence(()=>core_1.API.all("images/tags").getList(params),results=>results.length>0,10,1e3).then(results=>results).catch(()=>[])}}},function(module,exports){var path="docker/src/pipeline/trigger/dockerTrigger.html";window.angular.module("ng").run(["$templateCache",function(c){c.put(path,'<ng-form name="dockerForm">\n <docker-image-and-tag-selector\n specify-tag-by-regex="true"\n account="trigger.account"\n organization="trigger.organization"\n registry="trigger.registry"\n repository="trigger.repository"\n tag="trigger.tag"\n show-registry="true"\n on-change="ctrl.onChange"></docker-image-and-tag-selector>\n\n <div class="form-group" ng-if="vm.fiatEnabled">\n <run-as-user-selector service-accounts="vm.serviceAccounts"\n component="vm.trigger"\n field="runAsUser">\n </run-as-user-selector>\n </div>\n</ng-form>\n')}]),module.exports=path},function(module,exports){var path="docker/src/pipeline/stages/bake/bakeStage.html";window.angular.module("ng").run(["$templateCache",function(c){c.put(path,'<div ng-controller="dockerBakeStageCtrl as bakeStageCtrl">\n <stage-config-field label="Package" help-key="pipeline.config.bake.package">\n <input type="text" class="form-control input-sm"\n ng-model="stage.package"/>\n </stage-config-field>\n <stage-config-field label="Organization" help-key="pipeline.config.docker.bake.organization">\n <input type="text" class="form-control input-sm"\n ng-model="stage.organization"/>\n </stage-config-field>\n <stage-config-field label="Image Name" help-key="pipeline.config.docker.bake.targetImage">\n <input type="text" class="form-control input-sm"\n ng-model="stage.ami_name"/>\n </stage-config-field>\n <stage-config-field label="Image tag" help-key="pipeline.config.docker.bake.targetImageTag">\n <input type="text" class="form-control input-sm"\n ng-model="stage.extendedAttributes[\'docker_target_image_tag\']"/>\n </stage-config-field>\n <stage-config-field label="Base OS">\n <bake-stage-choose-os model="stage.baseOs" base-os-options="baseOsOptions"></bake-stage-choose-os>\n </stage-config-field>\n\n <stage-config-field label="Base Label">\n <label class="radio-inline" ng-repeat="baseLabel in baseLabelOptions">\n <input type="radio"\n ng-model="stage.baseLabel"\n ng-value="baseLabel"/>\n {{baseLabel}}\n </label>\n </stage-config-field>\n <stage-config-field label="Rebake">\n <div class="checkbox" style="margin-bottom: 0">\n <label>\n <input type="checkbox"\n ng-model="stage.rebake">\n </input>\n Rebake image without regard to the status of any existing bake\n </label>\n </div>\n </stage-config-field>\n</div>\n')}]),module.exports=path},function(module,exports){var path="docker/src/pipeline/stages/bake/bakeExecutionDetails.html";window.angular.module("ng").run(["$templateCache",function(c){c.put(path,'<div ng-controller="dockerBakeExecutionDetailsCtrl">\n <execution-details-section-nav sections="configSections"></execution-details-section-nav>\n <div class="step-section-details" ng-if="detailsSection === \'bakeConfig\'">\n <div class="row">\n <div class="col-md-6">\n <dl class="dl-narrow dl-horizontal">\n <dt if-multiple-providers>Provider</dt>\n <dd if-multiple-providers>Docker</dd>\n <dt>Organization</dt>\n <dd>{{stage.context.organization}}</dd>\n <dt>Image Name</dt>\n <dd>{{stage.context.ami_name}}</dd>\n <dt>Image Tag</dt>\n <dd>{{stage.context.extendedAttributes[\'docker_target_image_tag\']}}</dd>\n <dt>Image</dt>\n <dd>{{stage.context.ami}}</dd>\n </dl>\n </div>\n <div class="col-md-6">\n <dl class="dl-narrow dl-horizontal">\n <dt>Base OS</dt>\n <dd>{{stage.context.baseOs}}</dd>\n <dt>Region</dt>\n <dd>{{stage.context.region}}</dd>\n <dt>Package</dt>\n <dd>{{stage.context.package}}</dd>\n <dt>Label</dt>\n <dd>{{stage.context.baseLabel}}</dd>\n </dl>\n </div>\n </div>\n <stage-failure-message stage="stage" message="stage.failureMessage"></stage-failure-message>\n\n <div class="row" ng-if="stage.context.region && stage.context.status.resourceId">\n <div class="col-md-12">\n <div class="alert alert-{{stage.isFailed ? \'danger\' : \'info\'}}">\n <a target="_blank" href="{{ bakeryDetailUrl(stage) }}">\n View Bakery Details\n </a>\n </div>\n </div>\n </div>\n\n </div>\n <div class="step-section-details" ng-if="detailsSection === \'taskStatus\'">\n <div class="row">\n <execution-step-details item="stage"></execution-step-details>\n </div>\n </div>\n</div>\n')}]),module.exports=path},function(module,exports){var path="docker/src/image/dockerImageAndTagSelector.component.html";window.angular.module("ng").run(["$templateCache",function(c){c.put(path,'<div class="form-group" ng-if="$ctrl.showRegistry">\n <div ng-class="$ctrl.labelClass" class="sm-label-right">\n Registry Name\n </div>\n <div ng-class="$ctrl.fieldClass">\n <ui-select ng-model="$ctrl.account"\n ng-disabled="$ctrl.viewState.imagesRefreshing"\n ng-change="$ctrl.changeAccount()"\n class="form-control input-sm">\n <ui-select-match>{{$ctrl.account}}</ui-select-match>\n <ui-select-choices repeat="account in $ctrl.accounts | filter: $select.search | orderBy">\n <span ng-bind-html="account | highlight: $select.search"></span>\n </ui-select-choices>\n </ui-select>\n </div>\n <div class="col-md-1 text-center">\n <a href\n ng-click="$ctrl.refreshImages()"\n tooltip-placement="right"\n uib-tooltip="{{$ctrl.viewState.imagesRefreshing ? \'Images refreshing.\' : \'Refresh images list\' }}">\n <span ng-class="{\'fa-spin\':$ctrl.viewState.imagesRefreshing}"\n class="fa fa-sync-alt"></span>\n </a>\n </div>\n</div>\n<div class="form-group">\n <div ng-class="$ctrl.labelClass" class="sm-label-right">\n Organization\n </div>\n <div ng-class="$ctrl.fieldClass">\n <input class="form-control input-sm"\n ng-if="$ctrl.organization.includes(\'${\')"\n ng-model="$ctrl.organization"/>\n <ui-select ng-model="$ctrl.organization"\n ng-if="!$ctrl.organization.includes(\'${\')"\n ng-disabled="$ctrl.viewState.imagesRefreshing"\n ng-change="$ctrl.updateRepositoryList()" class="form-control input-sm">\n <ui-select-match placeholder="No organization">{{$ctrl.organization}}</ui-select-match>\n <ui-select-choices repeat="organization in $ctrl.organizations | filter: $select.search | orderBy">\n <span ng-bind-html="organization || \'No organization\' | highlight: $select.search"></span>\n </ui-select-choices>\n </ui-select>\n </div>\n</div>\n<div class="form-group">\n <div ng-class="$ctrl.labelClass" class="sm-label-right">\n Image\n </div>\n <div ng-class="$ctrl.fieldClass">\n <input class="form-control input-sm"\n ng-if="$ctrl.repository.includes(\'${\')"\n ng-model="$ctrl.repository"/>\n <ui-select ng-model="$ctrl.repository"\n ng-if="!$ctrl.repository.includes(\'${\')"\n ng-disabled="$ctrl.viewState.imagesRefreshing"\n ng-change="$ctrl.updateTag()"\n class="form-control input-sm"\n required>\n <ui-select-match>{{$ctrl.repository}}</ui-select-match>\n <ui-select-choices repeat="repository in $ctrl.repositories | filter: $select.search | orderBy">\n <span ng-bind-html="repository | highlight: $select.search"></span>\n </ui-select-choices>\n </ui-select>\n </div>\n</div>\n<div class="form-group" ng-if="$ctrl.specifyTagByRegex">\n <div ng-class="$ctrl.labelClass" class="sm-label-right">\n Tag\n <help-field key="pipeline.config.docker.trigger.tag"></help-field>\n </div>\n <div ng-class="$ctrl.fieldClass">\n <input type="text"\n class="form-control input-sm"\n ng-model="$ctrl.tag"\n ng-disabled="$ctrl.viewState.imagesRefreshing || !$ctrl.repository"\n ng-change="$ctrl.updateTag()"/>\n </div>\n</div>\n<div class="form-group" ng-if="!$ctrl.specifyTagByRegex">\n <div ng-class="$ctrl.labelClass" class="sm-label-right">\n Tag\n </div>\n <div ng-class="$ctrl.fieldClass">\n <input class="form-control input-sm"\n ng-if="$ctrl.tag.includes(\'${\')"\n ng-model="$ctrl.tag"/>\n <ui-select ng-model="$ctrl.tag"\n ng-if="!$ctrl.tag.includes(\'${\')"\n ng-disabled="$ctrl.viewState.imagesRefreshing || !$ctrl.repository"\n ng-change="$ctrl.updateTag()"\n class="form-control input-sm"\n required>\n <ui-select-match placeholder="No tag">{{$ctrl.tag}}</ui-select-match>\n <ui-select-choices repeat="tag in $ctrl.tags | filter: $select.search | orderBy">\n <span ng-bind-html="tag || \'No tag\' | highlight: $select.search"></span>\n </ui-select-choices>\n </ui-select>\n </div>\n</div>\n')}]),module.exports=path},function(module,exports){module.exports=require("lodash")},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const angular_1=__webpack_require__(0),lodash_1=__webpack_require__(7),core_1=__webpack_require__(1),DockerImageReader_1=__webpack_require__(2);class DockerImageAndTagSelectorController{constructor(){this.viewState={imagesLoading:!1,imagesLoaded:!1,imagesRefreshing:!1},this.organizations=[]}updateOrganizationsList(){this.accountMap&&(this.showRegistry&&(this.registry=this.registryMap[this.account],this.onChange&&this.onChange({registry:this.registry})),this.organizations=this.accountMap[this.showRegistry?this.account:this.registry]||[],this.organizations.includes(this.organization)||!this.organization||this.organization.includes("${")||(this.organization=null),this.updateRepositoryList())}updateRepositoryList(){if(this.organizationMap){const key=`${this.showRegistry?this.account:this.registry}/${this.organization||""}`;this.repositories=this.organizationMap[key]||[],this.repositories.includes(this.repository)||!this.repository||this.repository.includes("${")||(this.repository=null),this.updateTag()}}updateTag(){if(this.specifyTagByRegex)""===lodash_1.trim(this.tag)&&this.tag&&(this.tag=null);else if(this.repositoryMap){const key=this.repository;this.tags=this.repositoryMap[key]||[],this.tags.includes(this.tag)||!this.tag||this.tag.includes("${")||(this.tag=null)}}updateRegistryMap(images){this.registryMap=images.reduce((map,image)=>(map[image.account]=image.registry,map),{})}updateAccountMap(images){const results=images.reduce((map,image)=>{const key=image.account;if(!key)return map;const parts=image.repository.split("/");parts.pop();const org=parts.join("/");return map[key]||(map[key]=[]),map[key].push(org),map},{});this.uniqMapEntries(results),this.accountMap=results}updateOrganizationMap(images){const results=images.reduce((map,image)=>{if(!image.repository)return map;const parts=image.repository.split("/");parts.pop();const key=`${image.account}/${parts.join("/")}`;return map[key]||(map[key]=[]),map[key].push(image.repository),map},{});this.uniqMapEntries(results),this.organizationMap=results}updateRepositoryMap(images){const results=images.reduce((map,image)=>{if(!image.repository)return map;const key=image.repository;return map[key]||(map[key]=[]),map[key].push(image.tag),map},{});this.uniqMapEntries(results),this.repositoryMap=results}initializeAccounts(){core_1.AccountService.listAccounts("dockerRegistry").then(accounts=>{this.accounts=accounts.map(account=>account.name),this.showRegistry&&!this.account&&(this.account=this.accounts[0]),this.refreshImages()})}initializeImages(){const imageConfig={provider:"dockerRegistry",account:this.showRegistry?this.account:this.registry};this.viewState.imagesLoading=!0;const imageLoader=DockerImageReader_1.DockerImageReader.findImages(imageConfig).then(images=>{this.imageLoader===imageLoader&&(this.updateRegistryMap(images),this.updateAccountMap(images),this.accounts=this.accounts||Object.keys(this.accountMap),this.updateOrganizationMap(images),this.organizations.push(...Object.keys(this.organizationMap)),this.updateRepositoryMap(images),this.updateOrganizationsList(),this.viewState.imagesLoaded=!0)}).finally(()=>{this.viewState.imagesLoading=!1,this.viewState.imagesRefreshing=!1});this.imageLoader=imageLoader}uniqMapEntries(map){Object.keys(map).forEach(k=>{map[k]=lodash_1.uniq(map[k])})}isNew(){return!(this.account||this.organization||this.registry||this.repository||this.tag)}refreshImages(){this.viewState.imagesRefreshing=!0,this.initializeImages()}changeAccount(){this.organization=this.repository=this.tag=null,this.initializeImages()}$onInit(){this.labelClass=this.labelClass||"col-md-3",this.fieldClass=this.fieldClass||"col-md-8",this.deferInitialization||!this.registry&&!this.isNew()||this.initializeAccounts()}$onChanges(changes){this.deferInitialization&&changes.registry&&lodash_1.isString(changes.registry.currentValue)&&this.initializeAccounts()}}exports.DockerImageAndTagSelectorController=DockerImageAndTagSelectorController;exports.DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT="spinnaker.docker.imageAndTagSelector.component",angular_1.module(exports.DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT,[]).component("dockerImageAndTagSelector",new class{constructor(){this.bindings={specifyTagByRegex:"=",organization:"=",registry:"<",repository:"=",tag:"=",account:"=",showRegistry:"<?",labelClass:"@?",fieldClass:"@?",onChange:"=?",deferInitialization:"=?"},this.controller=DockerImageAndTagSelectorController,this.templateUrl=__webpack_require__(6)}})},function(module,exports){module.exports=require("rxjs")},function(module,exports){module.exports=require("ngimport")},function(module,exports){module.exports=require("react")},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const React=__webpack_require__(11),ngimport_1=__webpack_require__(10),rxjs_1=__webpack_require__(9),core_1=__webpack_require__(1),DockerImageReader_1=__webpack_require__(2);exports.DockerTriggerTemplate=class extends React.Component{constructor(props){super(props),this.queryStream=new rxjs_1.Subject,this.handleQuery=(()=>{const trigger=this.props.command.trigger;return rxjs_1.Observable.fromPromise(DockerImageReader_1.DockerImageReader.findTags({provider:"dockerRegistry",account:trigger.account,repository:trigger.repository}))}),this.updateSelectedTag=(tag=>{const{command:command}=this.props,trigger=command.trigger;if(command.extraFields.tag=tag,trigger&&trigger.repository){let imageName="";trigger.registry&&(imageName+=trigger.registry+"/"),imageName+=trigger.repository,command.extraFields.artifacts=[{type:"docker/image",name:imageName,version:tag,reference:imageName+":"+tag}]}this.setState({selectedTag:tag})}),this.tagLoadSuccess=(tags=>{const{command:command}=this.props,trigger=command.trigger,newState={};if(newState.tags=tags,newState.tags.length){const defaultSelection=newState.tags.find(t=>t===trigger.tag)||newState.tags[0];newState.selectedTag=defaultSelection,this.updateSelectedTag(defaultSelection)}newState.tagsLoading=!1,this.setState(newState)}),this.tagLoadFailure=(()=>{this.setState({tagsLoading:!1,loadError:!0})}),this.initialize=(()=>{const{command:command}=this.props;this.subscription=this.queryStream.debounceTime(250).switchMap(this.handleQuery).subscribe(this.tagLoadSuccess,this.tagLoadFailure),command.extraFields={},"docker"===command.trigger.type?this.searchTags():this.subscription.unsubscribe()}),this.searchTags=((query="")=>{this.setState({tags:[`<span>Finding tags${query&&` matching ${query}`}...</span>`]}),this.queryStream.next()}),this.state={tags:[],tagsLoading:!0,loadError:!1,selectedTag:""}}static formatLabel(trigger){return ngimport_1.$q.when(`(Docker Registry) ${trigger.account?trigger.account+":":""} ${trigger.repository||""}`)}componentWillReceiveProps(nextProps){nextProps.command!==this.props.command&&this.initialize()}componentDidMount(){this.initialize()}render(){const{tags:tags,tagsLoading:tagsLoading,loadError:loadError,selectedTag:selectedTag}=this.state,options=tags.map(tag=>({value:tag}));return React.createElement("div",{className:"form-group"},React.createElement("label",{className:"col-md-4 sm-label-right"},"Tag"),tagsLoading&&React.createElement("div",{className:"col-md-6"},React.createElement("div",{className:"form-control-static text-center"},React.createElement(core_1.Spinner,{size:"small"}))),React.createElement("input",{type:"hidden",required:tagsLoading,value:selectedTag}),loadError&&React.createElement("div",{className:"col-md-6"},"Error loading tags!"),!tagsLoading&&React.createElement("div",{className:"col-md-6"},0===tags.length&&React.createElement("div",null,React.createElement("p",{className:"form-control-static"},"No tags found")),tags.length>0&&React.createElement(core_1.TetheredSelect,{options:options,optionRenderer:o=>React.createElement("span",null,o.value),clearable:!1,value:selectedTag,valueRenderer:o=>React.createElement("span",null,React.createElement("strong",null,o.value)),onChange:o=>this.updateSelectedTag(o.value)})))}}},function(module,exports,__webpack_require__){"use strict";var _core=__webpack_require__(1),_dockerImageAndTagSelector=__webpack_require__(8),_DockerTriggerTemplate=__webpack_require__(12);const angular=__webpack_require__(0);module.exports=angular.module("spinnaker.docker.pipeline.trigger",[_core.SERVICE_ACCOUNT_SERVICE,_dockerImageAndTagSelector.DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT]).config(function(){_core.Registry.pipeline.registerTrigger({label:"Docker Registry",description:"Executes the pipeline on an image update",key:"docker",controller:"DockerTriggerCtrl as ctrl",controllerAs:"vm",templateUrl:__webpack_require__(3),manualExecutionComponent:_DockerTriggerTemplate.DockerTriggerTemplate,validators:[{type:"requiredField",fieldName:"account",message:"<strong>Registry</strong> is a required field for Docker Registry triggers."},{type:"requiredField",fieldName:"repository",message:"<strong>Image</strong> is a required field for Docker Registry triggers."},{type:"serviceAccountAccess",preventSave:!0,message:"You do not have access to the service account configured in this pipeline's Docker Registry trigger.\n You will not be able to save your edits to this pipeline."}]})}).controller("DockerTriggerCtrl",["trigger","serviceAccountService",function(trigger,serviceAccountService){this.trigger=trigger,this.fiatEnabled=_core.SETTINGS.feature.fiatEnabled,serviceAccountService.getServiceAccounts().then(accounts=>{this.serviceAccounts=accounts||[]}),this.onChange=(changes=>{this.trigger.registry=changes.registry})}])},function(module,exports){module.exports=require("@uirouter/angularjs")},function(module,exports,__webpack_require__){"use strict";var _core=__webpack_require__(1);const angular=__webpack_require__(0);module.exports=angular.module("spinnaker.docker.pipeline.stage.bake.executionDetails.controller",[__webpack_require__(14).default]).controller("dockerBakeExecutionDetailsCtrl",["$scope","$stateParams","executionDetailsSectionService","$interpolate",function($scope,$stateParams,executionDetailsSectionService,$interpolate){$scope.configSections=["bakeConfig","taskStatus"];let initialized=()=>{$scope.detailsSection=$stateParams.details,$scope.provider=$scope.stage.context.cloudProviderType||"docker",$scope.bakeryDetailUrl=$interpolate(_core.SETTINGS.bakeryDetailUrl)},initialize=()=>executionDetailsSectionService.synchronizeSection($scope.configSections,initialized);initialize(),$scope.$on("$stateChangeSuccess",initialize)}])},function(module,exports,__webpack_require__){"use strict";var obj,_lodash=__webpack_require__(7),_lodash2=(obj=_lodash)&&obj.__esModule?obj:{default:obj},_core=__webpack_require__(1);const angular=__webpack_require__(0);module.exports=angular.module("spinnaker.docker.pipeline.stage.bakeStage",[__webpack_require__(15).name,_core.BAKERY_SERVICE]).config(function(){_core.Registry.pipeline.registerStage({provides:"bake",cloudProvider:"docker",label:"Bake",description:"Bakes an image in the specified region",templateUrl:__webpack_require__(4),executionDetailsUrl:__webpack_require__(5),executionLabelComponent:_core.BakeExecutionLabel,extraLabelLines:stage=>stage.masterStage.context.allPreviouslyBaked||stage.masterStage.context.somePreviouslyBaked?1:0,defaultTimeoutMs:36e5,validators:[{type:"requiredField",fieldName:"package"}],restartable:!0})}).controller("dockerBakeStageCtrl",["$scope","bakeryService","$q",function($scope,bakeryService,$q){$scope.stage.region="global",$scope.stage.user||($scope.stage.user=_core.AuthenticationService.getAuthenticatedUser().name),$scope.viewState={loading:!0},$scope.$watch("stage",function(){_lodash2.default.forOwn($scope.stage,function(val,key){""===val&&delete $scope.stage[key]})},!0),$scope.viewState.providerSelected=!0,$q.all({baseOsOptions:bakeryService.getBaseOsOptions("docker"),baseLabelOptions:bakeryService.getBaseLabelOptions()}).then(function(results){$scope.baseOsOptions=results.baseOsOptions.baseImages,$scope.baseLabelOptions=results.baseLabelOptions,!$scope.stage.baseOs&&$scope.baseOsOptions&&$scope.baseOsOptions.length&&($scope.stage.baseOs=$scope.baseOsOptions[0].id),!$scope.stage.baseLabel&&$scope.baseLabelOptions&&$scope.baseLabelOptions.length&&($scope.stage.baseLabel=$scope.baseLabelOptions[0]),$scope.viewState.loading=!1})}])},function(module,exports,__webpack_require__){var map={"./image/dockerImageAndTagSelector.component.html":6,"./pipeline/stages/bake/bakeExecutionDetails.html":5,"./pipeline/stages/bake/bakeStage.html":4,"./pipeline/trigger/dockerTrigger.html":3};function webpackContext(req){var id=webpackContextResolve(req);return __webpack_require__(id)}function webpackContextResolve(req){var id=map[req];if(!(id+1)){var e=new Error('Cannot find module "'+req+'".');throw e.code="MODULE_NOT_FOUND",e}return id}webpackContext.keys=function(){return Object.keys(map)},webpackContext.resolve=webpackContextResolve,module.exports=webpackContext,webpackContext.id=17},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const angular_1=__webpack_require__(0),dockerImageAndTagSelector_component_1=__webpack_require__(8);exports.IMAGE_MODULE="spinnaker.docker.image",angular_1.module(exports.IMAGE_MODULE,[dockerImageAndTagSelector_component_1.DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT])},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const angular_1=__webpack_require__(0),image_module_1=__webpack_require__(18),templates=__webpack_require__(17);templates.keys().forEach(function(key){templates(key)}),exports.DOCKER_MODULE="spinnaker.docker",angular_1.module(exports.DOCKER_MODULE,[__webpack_require__(16).name,__webpack_require__(13).name,image_module_1.IMAGE_MODULE])},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(m){for(var p in m)exports.hasOwnProperty(p)||(exports[p]=m[p])}(__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";function __export(m){for(var p in m)exports.hasOwnProperty(p)||(exports[p]=m[p])}Object.defineProperty(exports,"__esModule",{value:!0}),__export(__webpack_require__(20)),__export(__webpack_require__(19))}])}); | ||
//# sourceMappingURL=lib.js.map |
{ | ||
"name": "@spinnaker/docker", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"main": "lib/lib.js", | ||
@@ -5,0 +5,0 @@ "typings": "lib/index.d.ts", |
@@ -6,3 +6,3 @@ 'use strict'; | ||
import { AuthenticationService, BakeExecutionLabel, BAKERY_SERVICE, PIPELINE_CONFIG_PROVIDER } from '@spinnaker/core'; | ||
import { AuthenticationService, BakeExecutionLabel, BAKERY_SERVICE, Registry } from '@spinnaker/core'; | ||
@@ -16,8 +16,7 @@ /* | ||
.module('spinnaker.docker.pipeline.stage.bakeStage', [ | ||
PIPELINE_CONFIG_PROVIDER, | ||
require('./bakeExecutionDetails.controller.js').name, | ||
BAKERY_SERVICE, | ||
]) | ||
.config(function(pipelineConfigProvider) { | ||
pipelineConfigProvider.registerStage({ | ||
.config(function() { | ||
Registry.pipeline.registerStage({ | ||
provides: 'bake', | ||
@@ -24,0 +23,0 @@ cloudProvider: 'docker', |
@@ -5,3 +5,3 @@ 'use strict'; | ||
import { SERVICE_ACCOUNT_SERVICE, SETTINGS } from '@spinnaker/core'; | ||
import { Registry, SERVICE_ACCOUNT_SERVICE, SETTINGS } from '@spinnaker/core'; | ||
@@ -13,4 +13,4 @@ import { DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT } from 'docker/image/dockerImageAndTagSelector.component'; | ||
.module('spinnaker.docker.pipeline.trigger', [SERVICE_ACCOUNT_SERVICE, DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT]) | ||
.config(function(pipelineConfigProvider) { | ||
pipelineConfigProvider.registerTrigger({ | ||
.config(function() { | ||
Registry.pipeline.registerTrigger({ | ||
label: 'Docker Registry', | ||
@@ -17,0 +17,0 @@ description: 'Executes the pipeline on an image update', |
Sorry, the diff of this file is not supported yet
279436
55
1222