File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 build :
1010 commands :
1111 - echo Building the Docker image...
12- - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} -t ${FIPS_REPOSITORY_URI}:latest .
12+ - >
13+ docker build
14+ --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID}
15+ --tag ${FIPS_REPOSITORY_URI}:latest
16+ .
17+
1318 - docker image push --all-tags ${FIPS_REPOSITORY_URI}
1419 post_build :
1520 commands :
Original file line number Diff line number Diff line change @@ -4,15 +4,21 @@ phases:
44 commands :
55 - export DOCKER_BUILDKIT=1
66 - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)"
7+ - export COMMIT_HASH_SHORT="$(echo $COMMIT_HASH | cut -c 1-7)"
78 - echo Logging in to Amazon ECR...
89 - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI}
910 build :
1011 commands :
11- - export COMMIT_HASH_SHORT="$(echo $COMMIT_HASH | cut -c 1-7)"
12+ - >
1213 - echo Building the Docker image...
1314 - echo $COMMIT_HASH_SHORT
1415 - echo $BRANCH_NAME
15- - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --tag ${FIPS_REPOSITORY_URI}:${COMMIT_HASH_SHORT} --tag ${FIPS_REPOSITORY_URI}:${BRANCH_NAME} .
16+ docker build
17+ --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID}
18+ --tag ${FIPS_REPOSITORY_URI}:${COMMIT_HASH_SHORT}
19+ --tag ${FIPS_REPOSITORY_URI}:${BRANCH_NAME}
20+ .
21+
1622 - docker image push --all-tags ${FIPS_REPOSITORY_URI}
1723 post_build :
1824 commands :
Original file line number Diff line number Diff line change 1-
21version : 0.2
32phases :
43 pre_build :
@@ -12,7 +11,16 @@ phases:
1211 - PATCH_TAG=${TAG_NAME#"v"}
1312 - MINOR_TAG=${PATCH_TAG%.*}
1413 - MAJOR_TAG=${MINOR_TAG%.*}
15- - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} -t ${FIPS_REPOSITORY_URI}:${PATCH_TAG} -t ${FIPS_REPOSITORY_URI}:${MINOR_TAG} -t ${FIPS_REPOSITORY_URI}:${MAJOR_TAG} .
14+
15+ - echo Building the Docker image...
16+ - >
17+ docker build
18+ --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID}
19+ --tag ${FIPS_REPOSITORY_URI}:${PATCH_TAG}
20+ --tag ${FIPS_REPOSITORY_URI}:${MINOR_TAG
21+ --tag ${FIPS_REPOSITORY_URI}:${MAJOR_TAG}
22+ .
23+
1624 - docker image push --all-tags ${FIPS_REPOSITORY_URI}
1725 post_build :
1826 commands :
You can’t perform that action at this time.
0 commit comments