File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change 77 # https://circleci.com/orbs/registry/orb/circleci/aws-ecr
88 # required environment variables:
99 # https://circleci.com/docs/2.0/ecs-ecr/#configure-circleci-environment-variables
10- aws-ecr : circleci/aws-ecr@6.15.3
10+ aws-ecr : circleci/aws-ecr@8.1.2
1111
1212workflows :
1313 version : 2
@@ -32,6 +32,36 @@ workflows:
3232 tag : " latest,$CIRCLE_BRANCH,$CIRCLE_SHA1"
3333 # create the AWS ECR repo if it does not exist already.
3434 create-repo : true
35+ lifecycle-policy-path : >
36+ {
37+ "rules": [
38+ {
39+ "rulePriority": 1,
40+ "description": "Keep latest master image",
41+ "selection": {
42+ "tagStatus": "tagged",
43+ "tagPrefixList": ["master", "main"],
44+ "countType": "imageCountMoreThan",
45+ "countNumber": 5
46+ },
47+ "action": {
48+ "type": "expire"
49+ }
50+ },
51+ {
52+ "rulePriority": 2,
53+ "description": "Expire all images older than 90 days.",
54+ "selection": {
55+ "countType": "sinceImagePushed",
56+ "countNumber": 90,
57+ "countUnit": "days"
58+ },
59+ "action": {
60+ "type": "expire"
61+ }
62+ }
63+ ]
64+ }
3565 # provide the aws-ecr context (environment variables) to push docker_image into ecr.
3666 # https://circleci.com/docs/2.0/ecs-ecr/#configure-circleci-environment-variables
3767 context : aws-ecr
You can’t perform that action at this time.
0 commit comments