1
1
version : 2.1
2
2
orbs :
3
3
orb-tools :
circleci/[email protected]
4
- aws-cli : circleci/aws-cli@4 .0
4
+ aws-cli : circleci/aws-cli@5.1 .0
5
5
aws-ecr : {}
6
6
filters : &filters
7
7
tags :
52
52
source_tag : <<parameters.source_tag>>
53
53
target_tag : <<parameters.target_tag>>
54
54
profile_name : <<parameters.profile_name>>
55
+ login :
56
+ executor : <<parameters.executor>>
57
+ parameters :
58
+ region :
59
+ type : string
60
+ profile_name :
61
+ type : string
62
+ executor :
63
+ type : executor
64
+ auth :
65
+ type : steps
66
+ steps :
67
+ - steps : <<parameters.auth>>
68
+ - aws-ecr/ecr_login :
69
+ profile_name : <<parameters.profile_name>>
70
+ region : <<parameters.region>>
71
+
55
72
build-test-then-push-with-buildx :
56
73
machine :
57
74
image : ubuntu-2204:current
@@ -113,6 +130,9 @@ workflows:
113
130
auth :
114
131
- aws-cli/setup :
115
132
role_arn : arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST
133
+ profile_name : " default"
134
+ role_session_name : ecr-orb-test-session-buildx
135
+ region : " us-west-2"
116
136
attach_workspace : true
117
137
workspace_root : workspace
118
138
repo : aws-ecr-orb-${CIRCLE_SHA1:0:7}-build-test-then-push-with-buildx
@@ -135,6 +155,9 @@ workflows:
135
155
auth :
136
156
- aws-cli/setup :
137
157
role_arn : arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST
158
+ profile_name : " default"
159
+ role_session_name : ecr-orb-test-session-nopush
160
+ region : " us-west-2"
138
161
attach_workspace : true
139
162
workspace_root : workspace
140
163
repo : aws-ecr-orb-${CIRCLE_SHA1:0:7}-multi-platform-without-push
@@ -157,6 +180,9 @@ workflows:
157
180
auth :
158
181
- aws-cli/setup :
159
182
role_arn : arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST
183
+ profile_name : " default"
184
+ role_session_name : ecr-orb-test-session-default
185
+ region : " us-west-2"
160
186
attach_workspace : true
161
187
workspace_root : workspace
162
188
repo : aws-ecr-orb-${CIRCLE_SHA1:0:7}-default-profile
@@ -180,6 +206,9 @@ workflows:
180
206
auth :
181
207
- aws-cli/setup :
182
208
role_arn : arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST
209
+ profile_name : " default"
210
+ role_session_name : ecr-orb-test-session-cred-helper
211
+ region : " us-west-2"
183
212
attach_workspace : true
184
213
workspace_root : workspace
185
214
repo : aws-ecr-orb-${CIRCLE_SHA1:0:7}-credential-helper
@@ -210,6 +239,9 @@ workflows:
210
239
auth :
211
240
- aws-cli/setup :
212
241
role_arn : arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST
242
+ profile_name : " default"
243
+ role_session_name : ecr-orb-test-session-cache
244
+ region : " us-west-2"
213
245
attach_workspace : true
214
246
workspace_root : workspace
215
247
repo : aws-ecr-orb-${CIRCLE_SHA1:0:7}-cache-to-flag
@@ -226,13 +258,15 @@ workflows:
226
258
auth :
227
259
- aws-cli/setup :
228
260
role_arn : arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST
229
- profile_name : " OIDC-User"
261
+ profile_name : " default"
262
+ role_session_name : ecr-orb-test-session-public-registry
263
+ region : " us-west-2"
230
264
attach_workspace : true
231
265
workspace_root : workspace
232
266
repo : aws-ecr-orb-${CIRCLE_SHA1:0:7}-public_registry
233
267
create_repo : true
234
268
region : " us-west-2"
235
- profile_name : " OIDC-User "
269
+ profile_name : " default "
236
270
context : [CPE-OIDC]
237
271
tag : integration,myECRRepoTag
238
272
dockerfile : Dockerfile
@@ -243,7 +277,7 @@ workflows:
243
277
post-steps :
244
278
- run :
245
279
name : " Delete repository"
246
- command : aws ecr-public delete-repository --region us-east-1 --repository-name aws-ecr-orb-${CIRCLE_SHA1:0:7}-public_registry --force --profile OIDC-User
280
+ command : aws ecr-public delete-repository --region us-east-1 --repository-name aws-ecr-orb-${CIRCLE_SHA1:0:7}-public_registry --force --profile default
247
281
platform : linux/arm64,linux/amd64
248
282
filters : *filters
249
283
requires : [pre-integration]
@@ -256,11 +290,14 @@ workflows:
256
290
auth :
257
291
- aws-cli/setup :
258
292
role_arn : arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST
259
- profile_name : " OIDC-User"
293
+ profile_name : " default"
294
+ role_session_name : ecr-orb-test-session-cred-helper-<<matrix.use_credentials_helper>>
295
+ region : " us-west-2"
260
296
attach_workspace : true
261
297
region : " us-west-2"
262
- profile_name : " OIDC-User "
298
+ profile_name : " default "
263
299
matrix :
300
+ alias : integration-test-named-profile
264
301
parameters :
265
302
use_credentials_helper : [true, false]
266
303
context : [CPE-OIDC]
@@ -283,10 +320,12 @@ workflows:
283
320
auth :
284
321
- aws-cli/setup :
285
322
role_arn : arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST
286
- profile_name : " OIDC-User"
323
+ profile_name : " default"
324
+ role_session_name : ecr-orb-test-session-tag-existing
325
+ region : " us-west-2"
287
326
repo : aws-ecr-orb-${CIRCLE_SHA1:0:7}-named-profile-true
288
327
region : " us-west-2"
289
- profile_name : " OIDC-User "
328
+ profile_name : " default "
290
329
context : [CPE-OIDC]
291
330
source_tag : integration
292
331
target_tag : latest
@@ -297,18 +336,20 @@ workflows:
297
336
auth :
298
337
- aws-cli/setup :
299
338
role_arn : arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST
300
- profile_name : " OIDC-User"
339
+ profile_name : " default"
340
+ role_session_name : ecr-orb-test-session-existing
341
+ region : " us-west-2"
301
342
repo : aws-ecr-orb-${CIRCLE_SHA1:0:7}-named-profile-true
302
343
region : " us-west-2"
303
- profile_name : " OIDC-User "
344
+ profile_name : " default "
304
345
context : [CPE-OIDC]
305
346
source_tag : integration
306
347
target_tag : alpha,latest
307
348
skip_when_tags_exist : true
308
349
post-steps :
309
350
- run :
310
351
name : " Delete repository"
311
- command : aws ecr delete-repository --repository-name aws-ecr-orb-${CIRCLE_SHA1:0:7}-named-profile-true --force --profile OIDC-User
352
+ command : aws ecr delete-repository --repository-name aws-ecr-orb-${CIRCLE_SHA1:0:7}-named-profile-true --force --profile default
312
353
filters : *filters
313
354
requires :
314
355
- integration-test-tag-existing-image
@@ -317,10 +358,12 @@ workflows:
317
358
auth :
318
359
- aws-cli/setup :
319
360
role_arn : arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST
320
- profile_name : " OIDC-User"
361
+ profile_name : " default"
362
+ role_session_name : ecr-orb-test-session-populate-<<matrix.executor>>
363
+ region : " us-west-2"
321
364
attach_workspace : true
322
365
region : " us-west-2"
323
- profile_name : " OIDC-User "
366
+ profile_name : " default "
324
367
context : [CPE-OIDC]
325
368
workspace_root : workspace
326
369
repo : aws-ecr-orb-${CIRCLE_SHA1:0:7}-skip_when_tags_exist-<<matrix.executor>>
@@ -332,6 +375,7 @@ workflows:
332
375
extra_build_args : --compress
333
376
skip_when_tags_exist : true
334
377
matrix :
378
+ alias : integration-test-skip_when_tags_exist-populate-image
335
379
parameters :
336
380
executor : ["arm64", "amd64"]
337
381
filters : *filters
@@ -341,10 +385,12 @@ workflows:
341
385
auth :
342
386
- aws-cli/setup :
343
387
role_arn : arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST
344
- profile_name : " OIDC-User"
388
+ profile_name : " default"
389
+ role_session_name : ecr-orb-test-session-<<matrix.executor>>
390
+ region : " us-west-2"
345
391
attach_workspace : true
346
392
region : " us-west-2"
347
- profile_name : " OIDC-User "
393
+ profile_name : " default "
348
394
context : [CPE-OIDC]
349
395
workspace_root : workspace
350
396
repo : aws-ecr-orb-${CIRCLE_SHA1:0:7}-skip_when_tags_exist-<<matrix.executor>>
@@ -358,26 +404,51 @@ workflows:
358
404
- run :
359
405
name : " Delete repository"
360
406
command : |
361
- aws ecr delete-repository --repository-name aws-ecr-orb-${CIRCLE_SHA1:0:7}-skip_when_tags_exist-<<matrix.executor>> --force --profile OIDC-User
407
+ aws ecr delete-repository --repository-name aws-ecr-orb-${CIRCLE_SHA1:0:7}-skip_when_tags_exist-<<matrix.executor>> --force --profile default
362
408
matrix :
409
+ alias : integration-test-skip_when_tags_exist
363
410
parameters :
364
- executor : ["amd64 ", "arm64 "]
411
+ executor : ["arm64 ", "amd64 "]
365
412
filters : *filters
366
413
requires :
367
- - integration-test-skip_when_tags_exist-populate-image-amd64
368
- - integration-test-skip_when_tags_exist-populate-image-arm64
369
- - orb-tools/lint :
370
- filters : *filters
371
- - orb-tools/pack :
372
- filters : *filters
373
- - orb-tools/review :
374
- filters : *release-filters
414
+ - integration-test-skip_when_tags_exist-populate-image
415
+ - login :
416
+ name : login-<<matrix.executor>>
417
+ auth :
418
+ - aws-cli/setup :
419
+ role_arn : arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST
420
+ profile_name : " default"
421
+ role_session_name : ecr-orb-test-session-login-<<matrix.executor>>
422
+ region : " us-west-2"
423
+ profile_name : " default"
424
+ region : " us-west-2"
425
+ context : [CPE-OIDC]
426
+ requires : [pre-integration]
427
+ matrix :
428
+ alias : login
429
+ parameters :
430
+ executor : ["arm64", "amd64"]
431
+ post-steps :
432
+ - run :
433
+ name : " Validation"
434
+ command : |
435
+ aws sts get-caller-identity --profile default
375
436
- orb-tools/publish :
376
437
orb_name : circleci/aws-ecr
377
438
vcs_type : << pipeline.project.type >>
378
439
pub_type : production
379
440
enable_pr_comment : true
380
- requires : [ orb-tools/lint, orb-tools/review, orb-tools/pack, integration-test-default-profile, integration-test-pubic-registry, integration-test-skip_when_tags_exist-amd64, integration-test-skip_when_tags_exist-arm64, integration-test-named-profile-true-helper, integration-test-named-profile-false-helper, integration-test-tag-existing-image, integration-test-tag-image-with-existing-tag ]
441
+ requires :
442
+ - build-test-then-push-with-buildx
443
+ - integration-test-multi-platform-without-push
444
+ - integration-test-default-profile
445
+ - integration-test-aws-ecr-credential-helper
446
+ - integration-test-cache-to-flag
447
+ - integration-test-pubic-registry
448
+ - integration-test-skip_when_tags_exist
449
+ - integration-test-named-profile-false-helper
450
+ - login
451
+ - integration-test-tag-image-with-existing-tag
381
452
github_token : GHI_TOKEN
382
453
context : orb-publisher
383
454
filters : *release-filters
0 commit comments