File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
ansible/roles/build-ecs-proxies/tasks Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 3131 ansible.builtin.command :
3232 cmd : " docker push {{ image_name }}"
3333 when : build_result.rc == 0
34+
35+ - name : Apply lifecycle policy to ecr {{ service_id }}_{{ item }}
36+ ansible.builtin.command :
37+ cmd : >
38+ {{ aws_cmd }} ecr put-lifecycle-policy
39+ --repository-name {{ service_id }}_{{ item }}
40+ --lifecycle-policy-text file://{{ base_dir }}/ecr/ecr_lifecycle.json
41+ when : lifecycle_check.rc != 0 and build_result.rc == 0
Original file line number Diff line number Diff line change 1+ {
2+ "rules" : [
3+ {
4+ "rulePriority" : 1 ,
5+ "description" : " Expire untagged images beyond the latest 3" ,
6+ "selection" : {
7+ "tagStatus" : " untagged" ,
8+ "countType" : " imageCountMoreThan" ,
9+ "countNumber" : 10
10+ },
11+ "action" : {
12+ "type" : " expire"
13+ }
14+ },
15+ {
16+ "rulePriority" : 2 ,
17+ "description" : " Retain ECS-protected images" ,
18+ "selection" : {
19+ "tagStatus" : " tagged" ,
20+ "tagPrefixList" : [" ecs-" ],
21+ "countType" : " imageCountMoreThan" ,
22+ "countNumber" : 9999
23+ },
24+ "action" : {
25+ "type" : " retain"
26+ }
27+ }
28+ ]
29+ }
You can’t perform that action at this time.
0 commit comments