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.9 to 0.0.10

2

.cache-loader/d296cbf96bffa71e0af983cd71c96038.json

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

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

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

Sorry, the diff of this file is not supported yet

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