Spinnaker Artifacts - Legacy UI

In Spinnaker, an artifact is an object that references an external resource. That resource could be…

  • a Docker image
  • a file stored in GitHub
  • an Amazon Machine Image (AMI)
  • a binary blob in S3, GCS, etc.

Any of these can be fetched using a , and can be used within a Spinnaker pipeline.

However, a URI alone isn’t always enough. Take the following examples:

  • Your build system produces provenance information about your Docker images (for example, which commit triggered the build, which build steps were used). This isn’t easy to store in or retrieve from the Docker image, but you want to trigger the pipeline on the arrival of a new image. If all you capture is the URI (for example, gcr.io/your-project/your-image:v1.0.0) you lose that provenance information.

  • Your Spinnaker instance is used by many teams in your organization, and your authorization policies isolate teams’ infrastructure and pipelines from each other. You probably want your packages, configs, and images published and accessible only by the teams that need them. You need a way to annotate a URI with an account that can fetch it based on a user’s permissions.

To address situations like these, Spinnaker includes a format for supplying URIs alongside pertinent metadata. We call this “artifact decoration”.

Decorate your artifacts

Examples

  1. // A docker image
  2. {
  3. "type": "docker/image",
  4. "reference": "gcr.io/project/image@sha256:29fee8e284",
  5. "name": "gcr.io/project/image",
  6. "version": "sha256:29fee8e284"
  7. }
  1. // An S3 object
  2. {
  3. "name": "s3://bucket/file.json",
  4. }

When you execute a pipeline with the <code>spin</code> CLI , the -t, --artifacts-file option expects a valid JSON file containing a top-level artifacts key that maps to an array of artifact definitions as mentioned . For example, you can call…

…with the contents of the file at ${ARTIFACTS_FILE_PATH} as follows:

  1. {
  2. "artifacts" : [
  3. {
  4. "name": "s3://bucket/file.json",
  5. "location": "us-east-1"
  6. },
  7. {
  8. "type": "s3/object",
  9. "name": "s3://bucket/file2.json",
  10. "location": "us-east-1"
  11. }
  12. }