Skip to content

seek-oss/create-ecr-buildkite-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Create ECR Buildkite Plugin

GitHub Release

A Buildkite plugin to create and manage an Amazon ECR repository.

Example

The following pipeline creates an ECR repository my-repo if it does not already exist, and sets the lifecycle policy to the default policies/default-lifecycle-policy.json:

steps:
  - command: echo 'use your new ECR repo here'
    label: ecr
    plugins:
      - seek-oss/create-ecr#v1.4.0:
          name: my-repo

A custom lifecycle policy and repository policy may be specified:

steps:
  - command: echo 'use your new ECR repo here'
    label: ecr
    plugins:
      - seek-oss/create-ecr#v1.4.0:
          lifecycle-policy: path/to/lifecycle-policy.json
          name: my-repo
          repository-policy: path/to/repository-policy.json

A custom ECR repository tags file may be specified:

steps:
  - command: echo 'use your new ECR repo here'
    label: ecr
    plugins:
      - seek-oss/create-ecr#v1.4.0:
          name: my-repo
          repository-tags-file: path/to/repository-tags-file.json

Multiple regions can be specified:

steps:
  - command: echo 'use your new ECR repo here'
    label: ecr
    plugins:
      - seek-oss/create-ecr#v1.4.0:
          name: my-repo
          regions:
            - us-west-2
            - ap-southeast-2

Configuration

  • name (required, string)

    Name of the ECR repository.

  • scan-on-push (optional, boolean)

    Whether to automatically scan images pushed to the ECR repository for vulnerabilities. Omitting this option will leave the existing image scanning configuration untouched.

  • repository-policy (optional, string)

    Path in local repository to the repository policy file.

  • lifecycle-policy (optional, string)

    Path in local repository to the lifecycle policy file.

  • repository-tags-file (optional, string)

    Path in local repository to the ecr repository tags file.

  • regions (optional, array of strings)

    Regions to push the images to. If not mentioned, current region is pulled from runtime config.

  • image-tag-mutability (optional, string)

    Sets the mutability settings for the repository. Can be MUTABLE or IMMUTABLE. Omitting this option will leave the mutability configuration untouched. When using seek-oss/docker-ecr-publish you should set add-latest-tag to false.

Troubleshooting

🚨 Error: No command has been provided

This plugin runs on a pre-command hook to allow it to be chained with other commands and plugins, like the docker-ecr-publish plugin. You will need to specify a command for the step, even if it is just a simple echo like in the examples above.

License

MIT (see LICENSE)

About

Create and manage an Amazon ECR repository

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 10

Languages