https://github.com/seek-oss/create-ecr-buildkite-plugin
Create and manage an Amazon ECR repository
https://github.com/seek-oss/create-ecr-buildkite-plugin
buildkite-plugin
Last synced: 3 months ago
JSON representation
Create and manage an Amazon ECR repository
- Host: GitHub
- URL: https://github.com/seek-oss/create-ecr-buildkite-plugin
- Owner: seek-oss
- License: bsd-3-clause-clear
- Created: 2019-02-07T03:12:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-29T01:16:23.000Z (over 3 years ago)
- Last Synced: 2025-06-26T09:04:13.540Z (3 months ago)
- Topics: buildkite-plugin
- Language: Shell
- Homepage:
- Size: 28.3 KB
- Stars: 8
- Watchers: 7
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Create ECR Buildkite Plugin
[](https://github.com/seek-oss/create-ecr-buildkite-plugin/releases)
A [Buildkite plugin](https://buildkite.com/docs/agent/v3/plugins) 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](policies/default-lifecycle-policy.json):```yaml
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:
```yaml
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:
```yaml
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:
```yaml
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](https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html#scanning-repository) 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](https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-tag-mutability.html) 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.[`docker-ecr-publish` plugin]: https://github.com/seek-oss/docker-ecr-publish-buildkite-plugin
[`pre-command` hook]: https://buildkite.com/docs/agent/v3/hooks#available-hooks## License
MIT (see [LICENSE](LICENSE))