Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spinnaker/docker

Package Overview
Dependencies
Maintainers
10
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spinnaker/docker - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

2

.cache-loader/12400a38a63613fe69c0cdd0cc266bcf.json

@@ -1,1 +0,1 @@

{"remainingRequest":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/thread-loader/dist/cjs.js??ref--4-1!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/babel-loader/lib/index.js!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/envify-loader/index.js!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/eslint-loader/index.js!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker/src/pipeline/stages/bake/dockerBakeStage.js","dependencies":[{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker/src/pipeline/stages/bake/dockerBakeStage.js","mtime":1526599334900},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/.babelrc","mtime":1525706565698},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/cache-loader/dist/cjs.js","mtime":0},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/thread-loader/dist/cjs.js","mtime":0},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/babel-loader/lib/index.js","mtime":1520329890000},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/envify-loader/index.js","mtime":1398445883000},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/eslint-loader/index.js","mtime":1519638534000}],"contextDependencies":[],"result":["'use strict';\n\nvar _lodash = require('lodash');\n\nvar _lodash2 = _interopRequireDefault(_lodash);\n\nvar _core = require('@spinnaker/core');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst angular = require('angular');\n\n\n/*\n This stage is just here so that we can experiment with baking Docker containers within pipelines.\n Without this stage, programmatically-created pipelines with Docker bake stages would not render\n execution details.\n */\nmodule.exports = angular.module('spinnaker.docker.pipeline.stage.bakeStage', [require('./bakeExecutionDetails.controller.js').name, _core.BAKERY_SERVICE]).config(function () {\n _core.Registry.pipeline.registerStage({\n provides: 'bake',\n cloudProvider: 'docker',\n label: 'Bake',\n description: 'Bakes an image in the specified region',\n templateUrl: require('./bakeStage.html'),\n executionDetailsUrl: require('./bakeExecutionDetails.html'),\n executionLabelComponent: _core.BakeExecutionLabel,\n extraLabelLines: stage => {\n return stage.masterStage.context.allPreviouslyBaked || stage.masterStage.context.somePreviouslyBaked ? 1 : 0;\n },\n defaultTimeoutMs: 60 * 60 * 1000, // 60 minutes\n validators: [{ type: 'requiredField', fieldName: 'package' }],\n restartable: true\n });\n}).controller('dockerBakeStageCtrl', ['$scope', 'bakeryService', '$q', function ($scope, bakeryService, $q) {\n var stage = $scope.stage;\n\n stage.region = 'global';\n\n if (!$scope.stage.user) {\n $scope.stage.user = _core.AuthenticationService.getAuthenticatedUser().name;\n }\n\n $scope.viewState = {\n loading: true\n };\n\n function initialize() {\n $scope.viewState.providerSelected = true;\n $q.all({\n baseOsOptions: bakeryService.getBaseOsOptions('docker'),\n baseLabelOptions: bakeryService.getBaseLabelOptions()\n }).then(function (results) {\n $scope.baseOsOptions = results.baseOsOptions.baseImages;\n $scope.baseLabelOptions = results.baseLabelOptions;\n\n if (!$scope.stage.baseOs && $scope.baseOsOptions && $scope.baseOsOptions.length) {\n $scope.stage.baseOs = $scope.baseOsOptions[0].id;\n }\n if (!$scope.stage.baseLabel && $scope.baseLabelOptions && $scope.baseLabelOptions.length) {\n $scope.stage.baseLabel = $scope.baseLabelOptions[0];\n }\n $scope.viewState.loading = false;\n });\n }\n\n function deleteEmptyProperties() {\n _lodash2.default.forOwn($scope.stage, function (val, key) {\n if (val === '') {\n delete $scope.stage[key];\n }\n });\n }\n\n $scope.$watch('stage', deleteEmptyProperties, true);\n\n initialize();\n}]);",{"version":3,"sources":["src/pipeline/stages/bake/dockerBakeStage.js"],"names":["angular","require","module","exports","name","config","pipeline","registerStage","provides","cloudProvider","label","description","templateUrl","executionDetailsUrl","executionLabelComponent","extraLabelLines","stage","masterStage","context","allPreviouslyBaked","somePreviouslyBaked","defaultTimeoutMs","validators","type","fieldName","restartable","controller","$scope","bakeryService","$q","region","user","getAuthenticatedUser","viewState","loading","initialize","providerSelected","all","baseOsOptions","getBaseOsOptions","baseLabelOptions","getBaseLabelOptions","then","results","baseImages","baseOs","length","id","baseLabel","deleteEmptyProperties","forOwn","val","key","$watch"],"mappings":"AAAA;;AAGA;;;;AAEA;;;;AAHA,MAAMA,UAAUC,QAAQ,SAAR,CAAhB;;;AAKA;;;;;AAKAC,OAAOC,OAAP,GAAiBH,QACdE,MADc,CACP,2CADO,EACsC,CACnDD,QAAQ,sCAAR,EAAgDG,IADG,uBADtC,EAKdC,MALc,CAKP,YAAW;AACjB,iBAASC,QAAT,CAAkBC,aAAlB,CAAgC;AAC9BC,cAAU,MADoB;AAE9BC,mBAAe,QAFe;AAG9BC,WAAO,MAHuB;AAI9BC,iBAAa,wCAJiB;AAK9BC,iBAAaX,QAAQ,kBAAR,CALiB;AAM9BY,yBAAqBZ,QAAQ,6BAAR,CANS;AAO9Ba,qDAP8B;AAQ9BC,qBAAiBC,SAAS;AACxB,aAAOA,MAAMC,WAAN,CAAkBC,OAAlB,CAA0BC,kBAA1B,IAAgDH,MAAMC,WAAN,CAAkBC,OAAlB,CAA0BE,mBAA1E,GAAgG,CAAhG,GAAoG,CAA3G;AACD,KAV6B;AAW9BC,sBAAkB,KAAK,EAAL,GAAU,IAXE,EAWI;AAClCC,gBAAY,CAAC,EAAEC,MAAM,eAAR,EAAyBC,WAAW,SAApC,EAAD,CAZkB;AAa9BC,iBAAa;AAbiB,GAAhC;AA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AOX,KAAhB,EAAuB,UAASmC,GAAT,EAAcC,GAAd,EAAmB;AACxC,UAAID,QAAQ,EAAZ,EAAgB;AACd,eAAOxB,OAAOX,KAAP,CAAaoC,GAAb,CAAP;AACD;AACF,KAJD;AAKD;;AAEDzB,SAAO0B,MAAP,CAAc,OAAd,EAAuBJ,qBAAvB,EAA8C,IAA9C;;AAEAd;AACD,CAnEc,EAAjB","file":"dockerBakeStage.js","sourceRoot":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker","sourcesContent":["'use strict';\n\nconst angular = require('angular');\nimport _ from 'lodash';\n\nimport { AuthenticationService, BakeExecutionLabel, BAKERY_SERVICE, Registry } from '@spinnaker/core';\n\n/*\n This stage is just here so that we can experiment with baking Docker containers within pipelines.\n Without this stage, programmatically-created pipelines with Docker bake stages would not render\n execution details.\n */\nmodule.exports = angular\n .module('spinnaker.docker.pipeline.stage.bakeStage', [\n require('./bakeExecutionDetails.controller.js').name,\n BAKERY_SERVICE,\n ])\n .config(function() {\n Registry.pipeline.registerStage({\n provides: 'bake',\n cloudProvider: 'docker',\n label: 'Bake',\n description: 'Bakes an image in the specified region',\n templateUrl: require('./bakeStage.html'),\n executionDetailsUrl: require('./bakeExecutionDetails.html'),\n executionLabelComponent: BakeExecutionLabel,\n extraLabelLines: stage => {\n return stage.masterStage.context.allPreviouslyBaked || stage.masterStage.context.somePreviouslyBaked ? 1 : 0;\n },\n defaultTimeoutMs: 60 * 60 * 1000, // 60 minutes\n validators: [{ type: 'requiredField', fieldName: 'package' }],\n restartable: true,\n });\n })\n .controller('dockerBakeStageCtrl', function($scope, bakeryService, $q) {\n var stage = $scope.stage;\n\n stage.region = 'global';\n\n if (!$scope.stage.user) {\n $scope.stage.user = AuthenticationService.getAuthenticatedUser().name;\n }\n\n $scope.viewState = {\n loading: true,\n };\n\n function initialize() {\n $scope.viewState.providerSelected = true;\n $q\n .all({\n baseOsOptions: bakeryService.getBaseOsOptions('docker'),\n baseLabelOptions: bakeryService.getBaseLabelOptions(),\n })\n .then(function(results) {\n $scope.baseOsOptions = results.baseOsOptions.baseImages;\n $scope.baseLabelOptions = results.baseLabelOptions;\n\n if (!$scope.stage.baseOs && $scope.baseOsOptions && $scope.baseOsOptions.length) {\n $scope.stage.baseOs = $scope.baseOsOptions[0].id;\n }\n if (!$scope.stage.baseLabel && $scope.baseLabelOptions && $scope.baseLabelOptions.length) {\n $scope.stage.baseLabel = $scope.baseLabelOptions[0];\n }\n $scope.viewState.loading = false;\n });\n }\n\n function deleteEmptyProperties() {\n _.forOwn($scope.stage, function(val, key) {\n if (val === '') {\n delete $scope.stage[key];\n }\n });\n }\n\n $scope.$watch('stage', deleteEmptyProperties, true);\n\n initialize();\n });\n"]}]}
{"remainingRequest":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/thread-loader/dist/cjs.js??ref--4-1!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/babel-loader/lib/index.js!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/envify-loader/index.js!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/eslint-loader/index.js!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker/src/pipeline/stages/bake/dockerBakeStage.js","dependencies":[{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker/src/pipeline/stages/bake/dockerBakeStage.js","mtime":1527183034153},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/.babelrc","mtime":1525706565698},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/cache-loader/dist/cjs.js","mtime":0},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/thread-loader/dist/cjs.js","mtime":0},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/babel-loader/lib/index.js","mtime":1520329890000},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/envify-loader/index.js","mtime":1398445883000},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/eslint-loader/index.js","mtime":1519638534000}],"contextDependencies":[],"result":["'use strict';\n\nvar _lodash = require('lodash');\n\nvar _lodash2 = _interopRequireDefault(_lodash);\n\nvar _core = require('@spinnaker/core');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst angular = require('angular');\n\n\n/*\n This stage is just here so that we can experiment with baking Docker containers within pipelines.\n Without this stage, programmatically-created pipelines with Docker bake stages would not render\n execution details.\n */\nmodule.exports = angular.module('spinnaker.docker.pipeline.stage.bakeStage', [require('./bakeExecutionDetails.controller.js').name]).config(function () {\n _core.Registry.pipeline.registerStage({\n provides: 'bake',\n cloudProvider: 'docker',\n label: 'Bake',\n description: 'Bakes an image in the specified region',\n templateUrl: require('./bakeStage.html'),\n executionDetailsUrl: require('./bakeExecutionDetails.html'),\n executionLabelComponent: _core.BakeExecutionLabel,\n extraLabelLines: stage => {\n return stage.masterStage.context.allPreviouslyBaked || stage.masterStage.context.somePreviouslyBaked ? 1 : 0;\n },\n defaultTimeoutMs: 60 * 60 * 1000, // 60 minutes\n validators: [{ type: 'requiredField', fieldName: 'package' }],\n restartable: true\n });\n}).controller('dockerBakeStageCtrl', ['$scope', '$q', function ($scope, $q) {\n var stage = $scope.stage;\n\n stage.region = 'global';\n\n if (!$scope.stage.user) {\n $scope.stage.user = _core.AuthenticationService.getAuthenticatedUser().name;\n }\n\n $scope.viewState = {\n loading: true\n };\n\n function initialize() {\n $scope.viewState.providerSelected = true;\n $q.all({\n baseOsOptions: _core.BakeryReader.getBaseOsOptions('docker'),\n baseLabelOptions: _core.BakeryReader.getBaseLabelOptions()\n }).then(function (results) {\n $scope.baseOsOptions = results.baseOsOptions.baseImages;\n $scope.baseLabelOptions = results.baseLabelOptions;\n\n if (!$scope.stage.baseOs && $scope.baseOsOptions && $scope.baseOsOptions.length) {\n $scope.stage.baseOs = $scope.baseOsOptions[0].id;\n }\n if (!$scope.stage.baseLabel && $scope.baseLabelOptions && $scope.baseLabelOptions.length) {\n $scope.stage.baseLabel = $scope.baseLabelOptions[0];\n }\n $scope.viewState.loading = false;\n });\n }\n\n function deleteEmptyProperties() {\n _lodash2.default.forOwn($scope.stage, function (val, key) {\n if (val === '') {\n delete $scope.stage[key];\n }\n });\n }\n\n $scope.$watch('stage', deleteEmptyProperties, true);\n\n initialize();\n}]);",{"version":3,"sources":["src/pipeline/stages/bake/dockerBakeStage.js"],"names":["angular","require","module","exports","name","config","pipeline","registerStage","provides","cloudProvider","label","description","templateUrl","executionDetailsUrl","executionLabelComponent","extraLabelLines","stage","masterStage","context","allPreviouslyBaked","somePreviouslyBaked","defaultTimeoutMs","validators","type","fieldName","restartable","controller","$scope","$q","region","user","getAuthenticatedUser","viewState","loading","initialize","providerSelected","all","baseOsOptions","getBaseOsOptions","baseLabelOptions","getBaseLabelOptions","then","results","baseImages","baseOs","length","id","baseLabel","deleteEmptyProperties","forOwn","val","key","$watch"],"mappings":"AAAA;;AAGA;;;;AAEA;;;;AAHA,MAAMA,UAAUC,QAAQ,SAAR,CAAhB;;;AAKA;;;;;AAKAC,OAAOC,OAAP,GAAiBH,QACdE,MADc,CACP,2CADO,EACsC,CAACD,QAAQ,sCAAR,EAAgDG,IAAjD,CADtC,EAEdC,MAFc,CAEP,YAAW;AACjB,iBAASC,QAAT,CAAkBC,aAAlB,CAAgC;AAC9BC,cAAU,MADoB;AAE9BC,mBAAe,QAFe;AAG9BC,WAAO,MAHuB;AAI9BC,iBAAa,wCAJiB;AAK9BC,iBAAaX,QAAQ,kBAAR,CALiB;AAM9BY,yBAAqBZ,QAAQ,6BAAR,CANS;AAO9Ba,qDAP8B;AAQ9BC,qBAAiBC,SAAS;AACxB,aAAOA,MAAMC,WAAN,CAAkBC,OAAlB,CAA0BC,kBAA1B,IAAgDH,MAAMC,WAAN,CAAkBC,OAAlB,CAA0BE,mBAA1E,GAAgG,CAAhG,GAAoG,CAA3G;AACD,KAV6B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AxB,CAAzB;AACD;AACDZ,aAAOK,SAAP,CAAiBC,OAAjB,GAA2B,KAA3B;AACD,KAhBH;AAiBD;;AAED,WAASe,qBAAT,GAAiC;AAC/B,qBAAEC,MAAF,CAAStB,OAAOX,KAAhB,EAAuB,UAASkC,GAAT,EAAcC,GAAd,EAAmB;AACxC,UAAID,QAAQ,EAAZ,EAAgB;AACd,eAAOvB,OAAOX,KAAP,CAAamC,GAAb,CAAP;AACD;AACF,KAJD;AAKD;;AAEDxB,SAAOyB,MAAP,CAAc,OAAd,EAAuBJ,qBAAvB,EAA8C,IAA9C;;AAEAd;AACD,CAhEc,EAAjB","file":"dockerBakeStage.js","sourceRoot":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker","sourcesContent":["'use strict';\n\nconst angular = require('angular');\nimport _ from 'lodash';\n\nimport { AuthenticationService, BakeExecutionLabel, BakeryReader, Registry } from '@spinnaker/core';\n\n/*\n This stage is just here so that we can experiment with baking Docker containers within pipelines.\n Without this stage, programmatically-created pipelines with Docker bake stages would not render\n execution details.\n */\nmodule.exports = angular\n .module('spinnaker.docker.pipeline.stage.bakeStage', [require('./bakeExecutionDetails.controller.js').name])\n .config(function() {\n Registry.pipeline.registerStage({\n provides: 'bake',\n cloudProvider: 'docker',\n label: 'Bake',\n description: 'Bakes an image in the specified region',\n templateUrl: require('./bakeStage.html'),\n executionDetailsUrl: require('./bakeExecutionDetails.html'),\n executionLabelComponent: BakeExecutionLabel,\n extraLabelLines: stage => {\n return stage.masterStage.context.allPreviouslyBaked || stage.masterStage.context.somePreviouslyBaked ? 1 : 0;\n },\n defaultTimeoutMs: 60 * 60 * 1000, // 60 minutes\n validators: [{ type: 'requiredField', fieldName: 'package' }],\n restartable: true,\n });\n })\n .controller('dockerBakeStageCtrl', function($scope, $q) {\n var stage = $scope.stage;\n\n stage.region = 'global';\n\n if (!$scope.stage.user) {\n $scope.stage.user = AuthenticationService.getAuthenticatedUser().name;\n }\n\n $scope.viewState = {\n loading: true,\n };\n\n function initialize() {\n $scope.viewState.providerSelected = true;\n $q\n .all({\n baseOsOptions: BakeryReader.getBaseOsOptions('docker'),\n baseLabelOptions: BakeryReader.getBaseLabelOptions(),\n })\n .then(function(results) {\n $scope.baseOsOptions = results.baseOsOptions.baseImages;\n $scope.baseLabelOptions = results.baseLabelOptions;\n\n if (!$scope.stage.baseOs && $scope.baseOsOptions && $scope.baseOsOptions.length) {\n $scope.stage.baseOs = $scope.baseOsOptions[0].id;\n }\n if (!$scope.stage.baseLabel && $scope.baseLabelOptions && $scope.baseLabelOptions.length) {\n $scope.stage.baseLabel = $scope.baseLabelOptions[0];\n }\n $scope.viewState.loading = false;\n });\n }\n\n function deleteEmptyProperties() {\n _.forOwn($scope.stage, function(val, key) {\n if (val === '') {\n delete $scope.stage[key];\n }\n });\n }\n\n $scope.$watch('stage', deleteEmptyProperties, true);\n\n initialize();\n });\n"]}]}

@@ -1,1 +0,1 @@

{"remainingRequest":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/thread-loader/dist/cjs.js??ref--4-1!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/babel-loader/lib/index.js!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/envify-loader/index.js!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/eslint-loader/index.js!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker/src/pipeline/trigger/dockerTrigger.module.js","dependencies":[{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker/src/pipeline/trigger/dockerTrigger.module.js","mtime":1526599334900},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/.babelrc","mtime":1525706565698},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/cache-loader/dist/cjs.js","mtime":0},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/thread-loader/dist/cjs.js","mtime":0},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/babel-loader/lib/index.js","mtime":1520329890000},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/envify-loader/index.js","mtime":1398445883000},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/eslint-loader/index.js","mtime":1519638534000}],"contextDependencies":[],"result":["'use strict';\n\nvar _core = require('@spinnaker/core');\n\nvar _dockerImageAndTagSelector = require('docker/image/dockerImageAndTagSelector.component');\n\nvar _DockerTriggerTemplate = require('./DockerTriggerTemplate');\n\nconst angular = require('angular');\n\nmodule.exports = angular.module('spinnaker.docker.pipeline.trigger', [_core.SERVICE_ACCOUNT_SERVICE, _dockerImageAndTagSelector.DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT]).config(function () {\n _core.Registry.pipeline.registerTrigger({\n label: 'Docker Registry',\n description: 'Executes the pipeline on an image update',\n key: 'docker',\n controller: 'DockerTriggerCtrl as ctrl',\n controllerAs: 'vm',\n templateUrl: require('./dockerTrigger.html'),\n manualExecutionComponent: _DockerTriggerTemplate.DockerTriggerTemplate,\n validators: [{\n type: 'requiredField',\n fieldName: 'account',\n message: '<strong>Registry</strong> is a required field for Docker Registry triggers.'\n }, {\n type: 'requiredField',\n fieldName: 'repository',\n message: '<strong>Image</strong> is a required field for Docker Registry triggers.'\n }, {\n type: 'serviceAccountAccess',\n preventSave: true,\n 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.`\n }]\n });\n}).controller('DockerTriggerCtrl', ['trigger', 'serviceAccountService', function (trigger, serviceAccountService) {\n this.trigger = trigger;\n this.fiatEnabled = _core.SETTINGS.feature.fiatEnabled;\n\n serviceAccountService.getServiceAccounts().then(accounts => {\n this.serviceAccounts = accounts || [];\n });\n\n this.onChange = changes => {\n this.trigger.registry = changes.registry;\n };\n}]);",{"version":3,"sources":["src/pipeline/trigger/dockerTrigger.module.js"],"names":["angular","require","module","exports","config","pipeline","registerTrigger","label","description","key","controller","controllerAs","templateUrl","manualExecutionComponent","validators","type","fieldName","message","preventSave","trigger","serviceAccountService","fiatEnabled","feature","getServiceAccounts","then","accounts","serviceAccounts","onChange","changes","registry"],"mappings":"AAAA;;AAIA;;AAEA;;AACA;;AALA,MAAMA,UAAUC,QAAQ,SAAR,CAAhB;;AAOAC,OAAOC,OAAP,GAAiBH,QACdE,MADc,CACP,mCADO,EAC8B,mGAD9B,EAEdE,MAFc,CAEP,YAAW;AACjB,iBAASC,QAAT,CAAkBC,eAAlB,CAAkC;AAChCC,WAAO,iBADyB;AAEhCC,iBAAa,0CAFmB;AAGhCC,SAAK,QAH2B;AAIhCC,gBAAY,2BAJoB;AAKhCC,kBAAc,IALkB;AAMhCC,iBAAaX,QAAQ,sBAAR,CANmB;AAOhCY,0EAPgC;AAQhCC,gBAAY,CACV;AACEC,YAAM,eADR;AAEEC,iBAAW,SAFb;AAGEC,eAAS;AAHX,KADU,EAMV;AACEF,YAAM,eADR;AAEEC,iBAAW,YAFb;AAGEC,eAAS;AAHX,KANU,EAWV;AACEF,YAAM,sBADR;AAEEG,mBAAa,IAFf;AAGED,eAAU;;AAHZ,KAXU;AARoB,GAAlC;AA2BD,CA9Bc,EA+BdP,UA/Bc,CA+BH,mBA/BG,uCA+BkB,UAASS,OAAT,EAAkBC,qBAAlB,EAAyC;AACxE,OAAKD,OAAL,GAAeA,OAAf;AACA,OAAKE,WAAL,GAAmB,eAASC,OAAT,CAAiBD,WAApC;;AAEAD,wBAAsBG,kBAAtB,GAA2CC,IAA3C,CAAgDC,YAAY;AAC1D,SAAKC,eAAL,GAAuBD,YAAY,EAAnC;AACD,GAFD;;AAIA,OAAKE,QAAL,GAAgBC,WAAW;AACzB,SAAKT,OAAL,CAAaU,QAAb,GAAwBD,QAAQC,QAAhC;AACD,GAFD;AAGD,CA1Cc,EAAjB","file":"dockerTrigger.module.js","sourceRoot":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker","sourcesContent":["'use strict';\n\nconst angular = require('angular');\n\nimport { Registry, SERVICE_ACCOUNT_SERVICE, SETTINGS } from '@spinnaker/core';\n\nimport { DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT } from 'docker/image/dockerImageAndTagSelector.component';\nimport { DockerTriggerTemplate } from './DockerTriggerTemplate';\n\nmodule.exports = angular\n .module('spinnaker.docker.pipeline.trigger', [SERVICE_ACCOUNT_SERVICE, DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT])\n .config(function() {\n Registry.pipeline.registerTrigger({\n label: 'Docker Registry',\n description: 'Executes the pipeline on an image update',\n key: 'docker',\n controller: 'DockerTriggerCtrl as ctrl',\n controllerAs: 'vm',\n templateUrl: require('./dockerTrigger.html'),\n manualExecutionComponent: DockerTriggerTemplate,\n validators: [\n {\n type: 'requiredField',\n fieldName: 'account',\n message: '<strong>Registry</strong> is a required field for Docker Registry triggers.',\n },\n {\n type: 'requiredField',\n fieldName: 'repository',\n message: '<strong>Image</strong> is a required field for Docker Registry triggers.',\n },\n {\n type: 'serviceAccountAccess',\n preventSave: true,\n 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.`,\n },\n ],\n });\n })\n .controller('DockerTriggerCtrl', function(trigger, serviceAccountService) {\n this.trigger = trigger;\n this.fiatEnabled = SETTINGS.feature.fiatEnabled;\n\n serviceAccountService.getServiceAccounts().then(accounts => {\n this.serviceAccounts = accounts || [];\n });\n\n this.onChange = changes => {\n this.trigger.registry = changes.registry;\n };\n });\n"]}]}
{"remainingRequest":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/thread-loader/dist/cjs.js??ref--4-1!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/babel-loader/lib/index.js!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/envify-loader/index.js!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/eslint-loader/index.js!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker/src/pipeline/trigger/dockerTrigger.module.js","dependencies":[{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker/src/pipeline/trigger/dockerTrigger.module.js","mtime":1527183034154},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/.babelrc","mtime":1525706565698},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/cache-loader/dist/cjs.js","mtime":0},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/thread-loader/dist/cjs.js","mtime":0},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/babel-loader/lib/index.js","mtime":1520329890000},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/envify-loader/index.js","mtime":1398445883000},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/eslint-loader/index.js","mtime":1519638534000}],"contextDependencies":[],"result":["'use strict';\n\nvar _core = require('@spinnaker/core');\n\nvar _dockerImageAndTagSelector = require('docker/image/dockerImageAndTagSelector.component');\n\nvar _DockerTriggerTemplate = require('./DockerTriggerTemplate');\n\nconst angular = require('angular');\n\nmodule.exports = angular.module('spinnaker.docker.pipeline.trigger', [_dockerImageAndTagSelector.DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT]).config(function () {\n _core.Registry.pipeline.registerTrigger({\n label: 'Docker Registry',\n description: 'Executes the pipeline on an image update',\n key: 'docker',\n controller: 'DockerTriggerCtrl as ctrl',\n controllerAs: 'vm',\n templateUrl: require('./dockerTrigger.html'),\n manualExecutionComponent: _DockerTriggerTemplate.DockerTriggerTemplate,\n validators: [{\n type: 'requiredField',\n fieldName: 'account',\n message: '<strong>Registry</strong> is a required field for Docker Registry triggers.'\n }, {\n type: 'requiredField',\n fieldName: 'repository',\n message: '<strong>Image</strong> is a required field for Docker Registry triggers.'\n }, {\n type: 'serviceAccountAccess',\n preventSave: true,\n 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.`\n }]\n });\n}).controller('DockerTriggerCtrl', ['trigger', function (trigger) {\n this.trigger = trigger;\n this.fiatEnabled = _core.SETTINGS.feature.fiatEnabled;\n\n _core.ServiceAccountReader.getServiceAccounts().then(accounts => {\n this.serviceAccounts = accounts || [];\n });\n\n this.onChange = changes => {\n this.trigger.registry = changes.registry;\n };\n}]);",{"version":3,"sources":["src/pipeline/trigger/dockerTrigger.module.js"],"names":["angular","require","module","exports","config","pipeline","registerTrigger","label","description","key","controller","controllerAs","templateUrl","manualExecutionComponent","validators","type","fieldName","message","preventSave","trigger","fiatEnabled","feature","getServiceAccounts","then","accounts","serviceAccounts","onChange","changes","registry"],"mappings":"AAAA;;AAIA;;AAEA;;AACA;;AALA,MAAMA,UAAUC,QAAQ,SAAR,CAAhB;;AAOAC,OAAOC,OAAP,GAAiBH,QACdE,MADc,CACP,mCADO,EAC8B,oEAD9B,EAEdE,MAFc,CAEP,YAAW;AACjB,iBAASC,QAAT,CAAkBC,eAAlB,CAAkC;AAChCC,WAAO,iBADyB;AAEhCC,iBAAa,0CAFmB;AAGhCC,SAAK,QAH2B;AAIhCC,gBAAY,2BAJoB;AAKhCC,kBAAc,IALkB;AAMhCC,iBAAaX,QAAQ,sBAAR,CANmB;AAOhCY,0EAPgC;AAQhCC,gBAAY,CACV;AACEC,YAAM,eADR;AAEEC,iBAAW,SAFb;AAGEC,eAAS;AAHX,KADU,EAMV;AACEF,YAAM,eADR;AAEEC,iBAAW,YAFb;AAGEC,eAAS;AAHX,KANU,EAWV;AACEF,YAAM,sBADR;AAEEG,mBAAa,IAFf;AAGED,eAAU;;AAHZ,KAXU;AARoB,GAAlC;AA2BD,CA9Bc,EA+BdP,UA/Bc,CA+BH,mBA/BG,cA+BkB,UAASS,OAAT,EAAkB;AACjD,OAAKA,OAAL,GAAeA,OAAf;AACA,OAAKC,WAAL,GAAmB,eAASC,OAAT,CAAiBD,WAApC;;AAEA,6BAAqBE,kBAArB,GAA0CC,IAA1C,CAA+CC,YAAY;AACzD,SAAKC,eAAL,GAAuBD,YAAY,EAAnC;AACD,GAFD;;AAIA,OAAKE,QAAL,GAAgBC,WAAW;AACzB,SAAKR,OAAL,CAAaS,QAAb,GAAwBD,QAAQC,QAAhC;AACD,GAFD;AAGD,CA1Cc,EAAjB","file":"dockerTrigger.module.js","sourceRoot":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker","sourcesContent":["'use strict';\n\nconst angular = require('angular');\n\nimport { Registry, ServiceAccountReader, SETTINGS } from '@spinnaker/core';\n\nimport { DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT } from 'docker/image/dockerImageAndTagSelector.component';\nimport { DockerTriggerTemplate } from './DockerTriggerTemplate';\n\nmodule.exports = angular\n .module('spinnaker.docker.pipeline.trigger', [DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT])\n .config(function() {\n Registry.pipeline.registerTrigger({\n label: 'Docker Registry',\n description: 'Executes the pipeline on an image update',\n key: 'docker',\n controller: 'DockerTriggerCtrl as ctrl',\n controllerAs: 'vm',\n templateUrl: require('./dockerTrigger.html'),\n manualExecutionComponent: DockerTriggerTemplate,\n validators: [\n {\n type: 'requiredField',\n fieldName: 'account',\n message: '<strong>Registry</strong> is a required field for Docker Registry triggers.',\n },\n {\n type: 'requiredField',\n fieldName: 'repository',\n message: '<strong>Image</strong> is a required field for Docker Registry triggers.',\n },\n {\n type: 'serviceAccountAccess',\n preventSave: true,\n 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.`,\n },\n ],\n });\n })\n .controller('DockerTriggerCtrl', function(trigger) {\n this.trigger = trigger;\n this.fiatEnabled = SETTINGS.feature.fiatEnabled;\n\n ServiceAccountReader.getServiceAccounts().then(accounts => {\n this.serviceAccounts = accounts || [];\n });\n\n this.onChange = changes => {\n this.trigger.registry = changes.registry;\n };\n });\n"]}]}

@@ -1,1 +0,1 @@

{"remainingRequest":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/thread-loader/dist/cjs.js??ref--5-1!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/ts-loader/index.js??ref--5-2!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/tslint-loader/index.js!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker/src/pipeline/trigger/DockerTriggerTemplate.tsx","dependencies":[{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker/src/pipeline/trigger/DockerTriggerTemplate.tsx","mtime":1526575022848},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/cache-loader/dist/cjs.js","mtime":0},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/thread-loader/dist/cjs.js","mtime":0},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/ts-loader/index.js","mtime":1525713677000},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/tslint-loader/index.js","mtime":1519899048000}],"contextDependencies":[],"result":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst React = require(\"react\");\nconst ngimport_1 = require(\"ngimport\");\nconst rxjs_1 = require(\"rxjs\");\nconst core_1 = require(\"@spinnaker/core\");\nconst DockerImageReader_1 = require(\"docker/image/DockerImageReader\");\nclass DockerTriggerTemplate extends React.Component {\n constructor(props) {\n super(props);\n this.queryStream = new rxjs_1.Subject();\n this.handleQuery = () => {\n const trigger = this.props.command.trigger;\n return rxjs_1.Observable.fromPromise(DockerImageReader_1.DockerImageReader.findTags({\n provider: 'dockerRegistry',\n account: trigger.account,\n repository: trigger.repository,\n }));\n };\n this.updateSelectedTag = (tag) => {\n const { command } = this.props;\n const trigger = command.trigger;\n command.extraFields.tag = tag;\n if (trigger && trigger.repository) {\n let imageName = '';\n if (trigger.registry) {\n imageName += trigger.registry + '/';\n }\n imageName += trigger.repository;\n command.extraFields.artifacts = [\n {\n type: 'docker/image',\n name: imageName,\n version: tag,\n reference: imageName + ':' + tag,\n },\n ];\n }\n this.setState({ selectedTag: tag });\n };\n this.tagLoadSuccess = (tags) => {\n const { command } = this.props;\n const trigger = command.trigger;\n const newState = {};\n newState.tags = tags;\n if (newState.tags.length) {\n // default to what is supplied by the trigger if possible; otherwise, use the latest\n const defaultSelection = newState.tags.find(t => t === trigger.tag) || newState.tags[0];\n newState.selectedTag = defaultSelection;\n this.updateSelectedTag(defaultSelection);\n }\n newState.tagsLoading = false;\n this.setState(newState);\n };\n this.tagLoadFailure = () => {\n this.setState({\n tagsLoading: false,\n loadError: true,\n });\n };\n this.initialize = () => {\n const { command } = this.props;\n this.subscription = this.queryStream\n .debounceTime(250)\n .switchMap(this.handleQuery)\n .subscribe(this.tagLoadSuccess, this.tagLoadFailure);\n // These fields will be added to the trigger when the form is submitted\n command.extraFields = {};\n // cancel search stream if trigger has changed to some other type\n if (command.trigger.type !== 'docker') {\n this.subscription.unsubscribe();\n return;\n }\n this.searchTags();\n };\n this.searchTags = (query = '') => {\n this.setState({ tags: [`<span>Finding tags${query && ` matching ${query}`}...</span>`] });\n this.queryStream.next();\n };\n this.state = {\n tags: [],\n tagsLoading: true,\n loadError: false,\n selectedTag: '',\n };\n }\n static formatLabel(trigger) {\n return ngimport_1.$q.when(`(Docker Registry) ${trigger.account ? trigger.account + ':' : ''} ${trigger.repository || ''}`);\n }\n componentWillReceiveProps(nextProps) {\n if (nextProps.command !== this.props.command) {\n this.initialize();\n }\n }\n componentDidMount() {\n this.initialize();\n }\n render() {\n const { tags, tagsLoading, loadError, selectedTag } = this.state;\n const options = tags.map(tag => {\n return { value: tag };\n });\n return (React.createElement(\"div\", { className: \"form-group\" },\n React.createElement(\"label\", { className: \"col-md-4 sm-label-right\" }, \"Tag\"),\n tagsLoading && (React.createElement(\"div\", { className: \"col-md-6\" },\n React.createElement(\"div\", { className: \"form-control-static text-center\" },\n React.createElement(core_1.Spinner, { size: 'small' })))),\n React.createElement(\"input\", { type: \"hidden\", required: tagsLoading, value: selectedTag }),\n loadError && React.createElement(\"div\", { className: \"col-md-6\" }, \"Error loading tags!\"),\n !tagsLoading && (React.createElement(\"div\", { className: \"col-md-6\" },\n tags.length === 0 && (React.createElement(\"div\", null,\n React.createElement(\"p\", { className: \"form-control-static\" }, \"No tags found\"))),\n tags.length > 0 && (React.createElement(core_1.TetheredSelect, { options: options, optionRenderer: o => React.createElement(\"span\", null, o.value), clearable: false, value: selectedTag, valueRenderer: o => (React.createElement(\"span\", null,\n React.createElement(\"strong\", null, o.value))), onChange: (o) => this.updateSelectedTag(o.value) }))))));\n }\n}\nexports.DockerTriggerTemplate = DockerTriggerTemplate;\n",{"version":3,"file":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker/src/pipeline/trigger/DockerTriggerTemplate.tsx","sourceRoot":"","sources":["/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/tslint-loader/index.js!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker/src/pipeline/trigger/DockerTriggerTemplate.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAG/B,uCAA8B;AAC9B,+BAAyD;AAEzD,0CAA0G;AAE1G,sEAAmE;AASnE,2BAAmC,SAAQ,KAAK,CAAC,SAGhD;IAQC,YAAmB,KAAqC;QACtD,KAAK,CAAC,KAAK,CAAC,CAAC;QARP,gBAAW,GAAG,IAAI,cAAO,EAAE,CAAC;QAiB5B,gBAAW,GAAG,GAAG,EAAE;YACzB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAyB,CAAC;YAC7D,OAAO,iBAAU,CAAC,WAAW,CAC3B,qCAAiB,CAAC,QAAQ,CAAC;gBACzB,QAAQ,EAAE,gBAAgB;gBAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,UAAU,EAAE,OAAO,CAAC,UAAU;aAC/B,CAAC,CACH,CAAC;QACJ,CAAC,CAAC;Q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;oBACE,2BAAG,SAAS,EAAC,qBAAqB,oBAAkB,CAChD,CACP;gBACA,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAClB,oBAAC,qBAAc,IACb,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,kCAAO,CAAC,CAAC,KAAK,CAAQ,EAC3C,SAAS,EAAE,KAAK,EAChB,KAAK,EAAE,WAAW,EAClB,aAAa,EAAE,CAAC,CAAC,EAAE,CAAC,CAClB;wBACE,oCAAS,CAAC,CAAC,KAAK,CAAU,CACrB,CACR,EACD,QAAQ,EAAE,CAAC,CAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,GAChE,CACH,CACG,CACP,CACG,CACP,CAAC;IACJ,CAAC;CACF;AA9JD,sDA8JC","sourcesContent":["import * as React from 'react';\nimport { Option } from 'react-select';\nimport { IPromise } from 'angular';\nimport { $q } from 'ngimport';\nimport { Observable, Subject, Subscription } from 'rxjs';\n\nimport { IDockerTrigger, ITriggerTemplateComponentProps, Spinner, TetheredSelect } from '@spinnaker/core';\n\nimport { DockerImageReader } from 'docker/image/DockerImageReader';\n\nexport interface IDockerTriggerTemplateState {\n tags: string[];\n tagsLoading: boolean;\n loadError: boolean;\n selectedTag: string;\n}\n\nexport class DockerTriggerTemplate extends React.Component<\n ITriggerTemplateComponentProps,\n IDockerTriggerTemplateState\n> {\n private queryStream = new Subject();\n private subscription: Subscription;\n\n public static formatLabel(trigger: IDockerTrigger): IPromise<string> {\n return $q.when(`(Docker Registry) ${trigger.account ? trigger.account + ':' : ''} ${trigger.repository || ''}`);\n }\n\n public constructor(props: ITriggerTemplateComponentProps) {\n super(props);\n this.state = {\n tags: [],\n tagsLoading: true,\n loadError: false,\n selectedTag: '',\n };\n }\n\n private handleQuery = () => {\n const trigger = this.props.command.trigger as IDockerTrigger;\n return Observable.fromPromise(\n DockerImageReader.findTags({\n provider: 'dockerRegistry',\n account: trigger.account,\n repository: trigger.repository,\n }),\n );\n };\n\n private updateSelectedTag = (tag: string) => {\n const { command } = this.props;\n const trigger = command.trigger as IDockerTrigger;\n command.extraFields.tag = tag;\n\n if (trigger && trigger.repository) {\n let imageName = '';\n if (trigger.registry) {\n imageName += trigger.registry + '/';\n }\n imageName += trigger.repository;\n command.extraFields.artifacts = [\n {\n type: 'docker/image',\n name: imageName,\n version: tag,\n reference: imageName + ':' + tag,\n },\n ];\n }\n this.setState({ selectedTag: tag });\n };\n\n private tagLoadSuccess = (tags: string[]) => {\n const { command } = this.props;\n const trigger = command.trigger as IDockerTrigger;\n const newState = {} as IDockerTriggerTemplateState;\n newState.tags = tags;\n if (newState.tags.length) {\n // default to what is supplied by the trigger if possible; otherwise, use the latest\n const defaultSelection = newState.tags.find(t => t === trigger.tag) || newState.tags[0];\n newState.selectedTag = defaultSelection;\n this.updateSelectedTag(defaultSelection);\n }\n newState.tagsLoading = false;\n this.setState(newState);\n };\n\n private tagLoadFailure = () => {\n this.setState({\n tagsLoading: false,\n loadError: true,\n });\n };\n\n private initialize = () => {\n const { command } = this.props;\n\n this.subscription = this.queryStream\n .debounceTime(250)\n .switchMap(this.handleQuery)\n .subscribe(this.tagLoadSuccess, this.tagLoadFailure);\n\n // These fields will be added to the trigger when the form is submitted\n command.extraFields = {};\n\n // cancel search stream if trigger has changed to some other type\n if (command.trigger.type !== 'docker') {\n this.subscription.unsubscribe();\n return;\n }\n\n this.searchTags();\n };\n\n public componentWillReceiveProps(nextProps: ITriggerTemplateComponentProps) {\n if (nextProps.command !== this.props.command) {\n this.initialize();\n }\n }\n\n public componentDidMount() {\n this.initialize();\n }\n\n private searchTags = (query = '') => {\n this.setState({ tags: [`<span>Finding tags${query && ` matching ${query}`}...</span>`] });\n this.queryStream.next();\n };\n\n public render() {\n const { tags, tagsLoading, loadError, selectedTag } = this.state;\n\n const options = tags.map(tag => {\n return { value: tag } as Option<string>;\n });\n\n return (\n <div className=\"form-group\">\n <label className=\"col-md-4 sm-label-right\">Tag</label>\n {tagsLoading && (\n <div className=\"col-md-6\">\n <div className=\"form-control-static text-center\">\n <Spinner size={'small'} />\n </div>\n </div>\n )}\n {/* prevent form submission while tags are loading */}\n <input type=\"hidden\" required={tagsLoading} value={selectedTag} />\n {loadError && <div className=\"col-md-6\">Error loading tags!</div>}\n {!tagsLoading && (\n <div className=\"col-md-6\">\n {tags.length === 0 && (\n <div>\n <p className=\"form-control-static\">No tags found</p>\n </div>\n )}\n {tags.length > 0 && (\n <TetheredSelect\n options={options}\n optionRenderer={o => <span>{o.value}</span>}\n clearable={false}\n value={selectedTag}\n valueRenderer={o => (\n <span>\n <strong>{o.value}</strong>\n </span>\n )}\n onChange={(o: Option<string>) => this.updateSelectedTag(o.value)}\n />\n )}\n </div>\n )}\n </div>\n );\n }\n}\n"]}]}
{"remainingRequest":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/thread-loader/dist/cjs.js??ref--5-1!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/ts-loader/index.js??ref--5-2!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/tslint-loader/index.js!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker/src/pipeline/trigger/DockerTriggerTemplate.tsx","dependencies":[{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker/src/pipeline/trigger/DockerTriggerTemplate.tsx","mtime":1526656657663},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/cache-loader/dist/cjs.js","mtime":0},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/thread-loader/dist/cjs.js","mtime":0},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/ts-loader/index.js","mtime":1525713677000},{"path":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/tslint-loader/index.js","mtime":1519899048000}],"contextDependencies":[],"result":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst React = require(\"react\");\nconst ngimport_1 = require(\"ngimport\");\nconst rxjs_1 = require(\"rxjs\");\nconst core_1 = require(\"@spinnaker/core\");\nconst DockerImageReader_1 = require(\"docker/image/DockerImageReader\");\nclass DockerTriggerTemplate extends React.Component {\n constructor(props) {\n super(props);\n this.queryStream = new rxjs_1.Subject();\n this.handleQuery = () => {\n const trigger = this.props.command.trigger;\n return rxjs_1.Observable.fromPromise(DockerImageReader_1.DockerImageReader.findTags({\n provider: 'dockerRegistry',\n account: trigger.account,\n repository: trigger.repository,\n }));\n };\n this.updateSelectedTag = (tag) => {\n const { command } = this.props;\n const trigger = command.trigger;\n command.extraFields.tag = tag;\n if (trigger && trigger.repository) {\n let imageName = '';\n if (trigger.registry) {\n imageName += trigger.registry + '/';\n }\n imageName += trigger.repository;\n command.extraFields.artifacts = [\n {\n type: 'docker/image',\n name: imageName,\n version: tag,\n reference: imageName + ':' + tag,\n },\n ];\n }\n this.setState({ selectedTag: tag });\n };\n this.tagLoadSuccess = (tags) => {\n const { command } = this.props;\n const trigger = command.trigger;\n const newState = {};\n newState.tags = tags;\n if (newState.tags.length) {\n // default to what is supplied by the trigger if possible; otherwise, use the latest\n const defaultSelection = newState.tags.find(t => t === trigger.tag) || newState.tags[0];\n newState.selectedTag = defaultSelection;\n this.updateSelectedTag(defaultSelection);\n }\n newState.tagsLoading = false;\n this.setState(newState);\n };\n this.tagLoadFailure = () => {\n this.setState({\n tagsLoading: false,\n loadError: true,\n });\n };\n this.initialize = () => {\n const { command } = this.props;\n this.subscription = this.queryStream\n .debounceTime(250)\n .switchMap(this.handleQuery)\n .subscribe(this.tagLoadSuccess, this.tagLoadFailure);\n // These fields will be added to the trigger when the form is submitted\n command.extraFields = {};\n // cancel search stream if trigger has changed to some other type\n if (command.trigger.type !== 'docker') {\n this.subscription.unsubscribe();\n return;\n }\n this.searchTags();\n };\n this.searchTags = (query = '') => {\n this.setState({ tags: [`<span>Finding tags${query && ` matching ${query}`}...</span>`] });\n this.queryStream.next();\n };\n this.state = {\n tags: [],\n tagsLoading: true,\n loadError: false,\n selectedTag: '',\n };\n }\n static formatLabel(trigger) {\n return ngimport_1.$q.when(`(Docker Registry) ${trigger.account ? trigger.account + ':' : ''} ${trigger.repository || ''}`);\n }\n componentWillReceiveProps(nextProps) {\n if (nextProps.command !== this.props.command) {\n this.initialize();\n }\n }\n componentDidMount() {\n this.initialize();\n }\n render() {\n const { tags, tagsLoading, loadError, selectedTag } = this.state;\n const options = tags.map(tag => {\n return { value: tag };\n });\n return (React.createElement(\"div\", { className: \"form-group\" },\n React.createElement(\"label\", { className: \"col-md-4 sm-label-right\" }, \"Tag\"),\n tagsLoading && (React.createElement(\"div\", { className: \"col-md-6\" },\n React.createElement(\"div\", { className: \"form-control-static text-center\" },\n React.createElement(core_1.Spinner, { size: 'small' })))),\n React.createElement(\"input\", { type: \"hidden\", required: tagsLoading, value: selectedTag }),\n loadError && React.createElement(\"div\", { className: \"col-md-6\" }, \"Error loading tags!\"),\n !tagsLoading && (React.createElement(\"div\", { className: \"col-md-6\" },\n tags.length === 0 && (React.createElement(\"div\", null,\n React.createElement(\"p\", { className: \"form-control-static\" }, \"No tags found\"))),\n tags.length > 0 && (React.createElement(core_1.TetheredSelect, { options: options, optionRenderer: o => React.createElement(\"span\", null, o.value), clearable: false, value: selectedTag, valueRenderer: o => (React.createElement(\"span\", null,\n React.createElement(\"strong\", null, o.value))), onChange: (o) => this.updateSelectedTag(o.value) }))))));\n }\n}\nexports.DockerTriggerTemplate = DockerTriggerTemplate;\n",{"version":3,"file":"/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker/src/pipeline/trigger/DockerTriggerTemplate.tsx","sourceRoot":"","sources":["/Users/jreynolds/Development/Netflix/git/spinnaker/deck/node_modules/tslint-loader/index.js!/Users/jreynolds/Development/Netflix/git/spinnaker/deck/app/scripts/modules/docker/src/pipeline/trigger/DockerTriggerTemplate.tsx"],"names":[],"mappings":";;AAAA,+BA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KAAK,EAAE,GAAG,EAAoB,CAAC;QAC1C,CAAC,CAAC,CAAC;QAEH,OAAO,CACL,6BAAK,SAAS,EAAC,YAAY;YACzB,+BAAO,SAAS,EAAC,yBAAyB,UAAY;YACrD,WAAW,IAAI,CACd,6BAAK,SAAS,EAAC,UAAU;gBACvB,6BAAK,SAAS,EAAC,iCAAiC;oBAC9C,oBAAC,cAAO,IAAC,IAAI,EAAE,OAAO,GAAI,CACtB,CACF,CACP;YAED,+BAAO,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,GAAI;YACjE,SAAS,IAAI,6BAAK,SAAS,EAAC,UAAU,0BAA0B;YAChE,CAAC,WAAW,IAAI,CACf,6BAAK,SAAS,EAAC,UAAU;gBACtB,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CACpB;oBACE,2BAAG,SAAS,EAAC,qBAAqB,oBAAkB,CAChD,CACP;gBACA,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAClB,oBAAC,qBAAc,IACb,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,kCAAO,CAAC,CAAC,KAAK,CAAQ,EAC3C,SAAS,EAAE,KAAK,EAChB,KAAK,EAAE,WAAW,EAClB,aAAa,EAAE,CAAC,CAAC,EAAE,CAAC,CAClB;wBACE,oCAAS,CAAC,CAAC,KAAK,CAAU,CACrB,CACR,EACD,QAAQ,EAAE,CAAC,CAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,GAChE,CACH,CACG,CACP,CACG,CACP,CAAC;IACJ,CAAC;CACF;AA9JD,sDA8JC","sourcesContent":["import * as React from 'react';\nimport { Option } from 'react-select';\nimport { IPromise } from 'angular';\nimport { $q } from 'ngimport';\nimport { Observable, Subject, Subscription } from 'rxjs';\n\nimport { IDockerTrigger, ITriggerTemplateComponentProps, Spinner, TetheredSelect } from '@spinnaker/core';\n\nimport { DockerImageReader } from 'docker/image/DockerImageReader';\n\nexport interface IDockerTriggerTemplateState {\n tags: string[];\n tagsLoading: boolean;\n loadError: boolean;\n selectedTag: string;\n}\n\nexport class DockerTriggerTemplate extends React.Component<\n ITriggerTemplateComponentProps,\n IDockerTriggerTemplateState\n> {\n private queryStream = new Subject();\n private subscription: Subscription;\n\n public static formatLabel(trigger: IDockerTrigger): IPromise<string> {\n return $q.when(`(Docker Registry) ${trigger.account ? trigger.account + ':' : ''} ${trigger.repository || ''}`);\n }\n\n public constructor(props: ITriggerTemplateComponentProps) {\n super(props);\n this.state = {\n tags: [],\n tagsLoading: true,\n loadError: false,\n selectedTag: '',\n };\n }\n\n private handleQuery = () => {\n const trigger = this.props.command.trigger as IDockerTrigger;\n return Observable.fromPromise(\n DockerImageReader.findTags({\n provider: 'dockerRegistry',\n account: trigger.account,\n repository: trigger.repository,\n }),\n );\n };\n\n private updateSelectedTag = (tag: string) => {\n const { command } = this.props;\n const trigger = command.trigger as IDockerTrigger;\n command.extraFields.tag = tag;\n\n if (trigger && trigger.repository) {\n let imageName = '';\n if (trigger.registry) {\n imageName += trigger.registry + '/';\n }\n imageName += trigger.repository;\n command.extraFields.artifacts = [\n {\n type: 'docker/image',\n name: imageName,\n version: tag,\n reference: imageName + ':' + tag,\n },\n ];\n }\n this.setState({ selectedTag: tag });\n };\n\n private tagLoadSuccess = (tags: string[]) => {\n const { command } = this.props;\n const trigger = command.trigger as IDockerTrigger;\n const newState = {} as IDockerTriggerTemplateState;\n newState.tags = tags;\n if (newState.tags.length) {\n // default to what is supplied by the trigger if possible; otherwise, use the latest\n const defaultSelection = newState.tags.find(t => t === trigger.tag) || newState.tags[0];\n newState.selectedTag = defaultSelection;\n this.updateSelectedTag(defaultSelection);\n }\n newState.tagsLoading = false;\n this.setState(newState);\n };\n\n private tagLoadFailure = () => {\n this.setState({\n tagsLoading: false,\n loadError: true,\n });\n };\n\n private initialize = () => {\n const { command } = this.props;\n\n this.subscription = this.queryStream\n .debounceTime(250)\n .switchMap(this.handleQuery)\n .subscribe(this.tagLoadSuccess, this.tagLoadFailure);\n\n // These fields will be added to the trigger when the form is submitted\n command.extraFields = {};\n\n // cancel search stream if trigger has changed to some other type\n if (command.trigger.type !== 'docker') {\n this.subscription.unsubscribe();\n return;\n }\n\n this.searchTags();\n };\n\n public componentWillReceiveProps(nextProps: ITriggerTemplateComponentProps) {\n if (nextProps.command !== this.props.command) {\n this.initialize();\n }\n }\n\n public componentDidMount() {\n this.initialize();\n }\n\n private searchTags = (query = '') => {\n this.setState({ tags: [`<span>Finding tags${query && ` matching ${query}`}...</span>`] });\n this.queryStream.next();\n };\n\n public render() {\n const { tags, tagsLoading, loadError, selectedTag } = this.state;\n\n const options = tags.map(tag => {\n return { value: tag } as Option<string>;\n });\n\n return (\n <div className=\"form-group\">\n <label className=\"col-md-4 sm-label-right\">Tag</label>\n {tagsLoading && (\n <div className=\"col-md-6\">\n <div className=\"form-control-static text-center\">\n <Spinner size={'small'} />\n </div>\n </div>\n )}\n {/* prevent form submission while tags are loading */}\n <input type=\"hidden\" required={tagsLoading} value={selectedTag} />\n {loadError && <div className=\"col-md-6\">Error loading tags!</div>}\n {!tagsLoading && (\n <div className=\"col-md-6\">\n {tags.length === 0 && (\n <div>\n <p className=\"form-control-static\">No tags found</p>\n </div>\n )}\n {tags.length > 0 && (\n <TetheredSelect\n options={options}\n optionRenderer={o => <span>{o.value}</span>}\n clearable={false}\n value={selectedTag}\n valueRenderer={o => (\n <span>\n <strong>{o.value}</strong>\n </span>\n )}\n onChange={(o: Option<string>) => this.updateSelectedTag(o.value)}\n />\n )}\n </div>\n )}\n </div>\n );\n }\n}\n"]}]}

@@ -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(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))}])});
!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",[_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",function(trigger){this.trigger=trigger,this.fiatEnabled=_core.SETTINGS.feature.fiatEnabled,_core.ServiceAccountReader.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]).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","$q",function($scope,$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:_core.BakeryReader.getBaseOsOptions("docker"),baseLabelOptions:_core.BakeryReader.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.11",
"version": "0.0.12",
"main": "lib/lib.js",

@@ -5,0 +5,0 @@ "typings": "lib/index.d.ts",

@@ -6,3 +6,3 @@ 'use strict';

import { AuthenticationService, BakeExecutionLabel, BAKERY_SERVICE, Registry } from '@spinnaker/core';
import { AuthenticationService, BakeExecutionLabel, BakeryReader, Registry } from '@spinnaker/core';

@@ -15,6 +15,3 @@ /*

module.exports = angular
.module('spinnaker.docker.pipeline.stage.bakeStage', [
require('./bakeExecutionDetails.controller.js').name,
BAKERY_SERVICE,
])
.module('spinnaker.docker.pipeline.stage.bakeStage', [require('./bakeExecutionDetails.controller.js').name])
.config(function() {

@@ -37,3 +34,3 @@ Registry.pipeline.registerStage({

})
.controller('dockerBakeStageCtrl', function($scope, bakeryService, $q) {
.controller('dockerBakeStageCtrl', function($scope, $q) {
var stage = $scope.stage;

@@ -55,4 +52,4 @@

.all({
baseOsOptions: bakeryService.getBaseOsOptions('docker'),
baseLabelOptions: bakeryService.getBaseLabelOptions(),
baseOsOptions: BakeryReader.getBaseOsOptions('docker'),
baseLabelOptions: BakeryReader.getBaseLabelOptions(),
})

@@ -59,0 +56,0 @@ .then(function(results) {

@@ -5,3 +5,3 @@ 'use strict';

import { Registry, SERVICE_ACCOUNT_SERVICE, SETTINGS } from '@spinnaker/core';
import { Registry, ServiceAccountReader, SETTINGS } from '@spinnaker/core';

@@ -12,3 +12,3 @@ import { DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT } from 'docker/image/dockerImageAndTagSelector.component';

module.exports = angular
.module('spinnaker.docker.pipeline.trigger', [SERVICE_ACCOUNT_SERVICE, DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT])
.module('spinnaker.docker.pipeline.trigger', [DOCKER_IMAGE_AND_TAG_SELECTOR_COMPONENT])
.config(function() {

@@ -43,7 +43,7 @@ Registry.pipeline.registerTrigger({

})
.controller('DockerTriggerCtrl', function(trigger, serviceAccountService) {
.controller('DockerTriggerCtrl', function(trigger) {
this.trigger = trigger;
this.fiatEnabled = SETTINGS.feature.fiatEnabled;
serviceAccountService.getServiceAccounts().then(accounts => {
ServiceAccountReader.getServiceAccounts().then(accounts => {
this.serviceAccounts = accounts || [];

@@ -50,0 +50,0 @@ });

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc