diff --git a/app/scripts/modules/core/src/help/help.contents.ts b/app/scripts/modules/core/src/help/help.contents.ts index 55a9dcd48b2..dc2b87d4435 100644 --- a/app/scripts/modules/core/src/help/help.contents.ts +++ b/app/scripts/modules/core/src/help/help.contents.ts @@ -117,6 +117,10 @@ module(HELP_CONTENTS, [])
The GCS object name, in the form gs://bucket/path/to/file.yml
.
The GCS object name, optionally appending the version. An example: gs://bucket/file.yml#123948581
The S3 object name, in the form s3://bucket/path/to/file.yml
.
The S3 object name, optionally appending the version. An example: s3://bucket/file.yml#123948581
The Docker image name you want to trigger on changes to. By default, this does not include the image tag or digest, only the registry and image repository.
`, 'pipeline.config.expectedArtifact.defaultDocker.reference': ` diff --git a/app/scripts/modules/core/src/pipeline/config/triggers/artifacts/artifact.module.ts b/app/scripts/modules/core/src/pipeline/config/triggers/artifacts/artifact.module.ts index e47c3385d34..02e9cd7552a 100644 --- a/app/scripts/modules/core/src/pipeline/config/triggers/artifacts/artifact.module.ts +++ b/app/scripts/modules/core/src/pipeline/config/triggers/artifacts/artifact.module.ts @@ -11,6 +11,8 @@ import { ARTIFACT } from './artifact.component'; import { GITHUB_ARTIFACT } from 'core/pipeline/config/triggers/artifacts/github/github.artifact'; import { BASE64_ARTIFACT } from 'core/pipeline/config/triggers/artifacts/base64/base64.artifact'; import { DEFAULT_BASE64_ARTIFACT } from 'core/pipeline/config/triggers/artifacts/base64/defaultBase64.artifact'; +import { S3_ARTIFACT } from 'core/pipeline/config/triggers/artifacts/s3/s3.artifact'; +import { DEFAULT_S3_ARTIFACT } from 'core/pipeline/config/triggers/artifacts/s3/defaultS3.artifact'; export const ARTIFACT_MODULE = 'spinnaker.core.pipeline.config.trigger.artifacts'; @@ -21,6 +23,8 @@ module(ARTIFACT_MODULE, [ GITHUB_ARTIFACT, DOCKER_ARTIFACT, BASE64_ARTIFACT, + S3_ARTIFACT, + DEFAULT_S3_ARTIFACT, DEFAULT_DOCKER_ARTIFACT, DEFAULT_GCS_ARTIFACT, DEFAULT_GITHUB_ARTIFACT, diff --git a/app/scripts/modules/core/src/pipeline/config/triggers/artifacts/s3/defaultS3.artifact.ts b/app/scripts/modules/core/src/pipeline/config/triggers/artifacts/s3/defaultS3.artifact.ts new file mode 100644 index 00000000000..4d14180bc99 --- /dev/null +++ b/app/scripts/modules/core/src/pipeline/config/triggers/artifacts/s3/defaultS3.artifact.ts @@ -0,0 +1,58 @@ +import { module } from 'angular'; + +import { PIPELINE_CONFIG_PROVIDER } from 'core/pipeline/config/pipelineConfigProvider'; +import { IArtifact } from 'core/domain/IArtifact'; +import { PipelineConfigProvider } from 'core/pipeline'; +import { isNil } from 'lodash'; + +export const DEFAULT_S3_ARTIFACT = 'spinnaker.core.pipeline.trigger.artifact.defaultS3'; +module(DEFAULT_S3_ARTIFACT, [ + PIPELINE_CONFIG_PROVIDER, +]).config((pipelineConfigProvider: PipelineConfigProvider) => { + pipelineConfigProvider.registerArtifactKind({ + label: 'S3', + description: 'A S3 object.', + key: 'default.s3', + isDefault: true, + isMatch: false, + controller(artifact: IArtifact) { + 'ngInject'; + this.artifact = artifact; + this.artifact.type = 's3/object'; + + this.onReferenceChange = () => { + const ref = this.artifact.reference; + if (isNil(ref)) { + return; + } + + if (ref.indexOf('#') >= 0) { + const split = ref.split('#'); + this.artifact.name = split[0]; + this.artifact.version = split[1]; + } else { + this.artifact.name = ref; + } + }; + }, + controllerAs: 'ctrl', + template: ` +