File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,13 +4,12 @@ phases:
44 commands :
55 - export DOCKER_BUILDKIT=1
66 - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)"
7- - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)"
8- build :
9- commands :
107 - echo Logging in to Amazon ECR...
118 - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI}
9+ build :
10+ commands :
1211 - echo Building the Docker image...
13- - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --build-arg ECR_REGION=${ECR_REGION} - t ${FIPS_REPOSITORY_URI}:latest .
12+ - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} -t ${FIPS_REPOSITORY_URI}:latest .
1413 - docker image push --all-tags ${FIPS_REPOSITORY_URI}
1514 post_build :
1615 commands :
Original file line number Diff line number Diff line change @@ -4,16 +4,15 @@ phases:
44 commands :
55 - export DOCKER_BUILDKIT=1
66 - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)"
7- - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)"
8- build :
9- commands :
107 - echo Logging in to Amazon ECR...
118 - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI}
9+ build :
10+ commands :
1211 - export COMMIT_HASH_SHORT="$(echo $COMMIT_HASH | cut -c 1-7)"
1312 - echo Building the Docker image...
1413 - echo $COMMIT_HASH_SHORT
1514 - echo $BRANCH_NAME
16- - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --build-arg ECR_REGION=${ECR_REGION} -- tag ${FIPS_REPOSITORY_URI}:${COMMIT_HASH_SHORT} --tag ${FIPS_REPOSITORY_URI}:${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} .
1716 - docker image push --all-tags ${FIPS_REPOSITORY_URI}
1817 post_build :
1918 commands :
Original file line number Diff line number Diff line change @@ -5,15 +5,14 @@ phases:
55 commands :
66 - export DOCKER_BUILDKIT=1
77 - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)"
8- - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)"
9- build :
10- commands :
118 - echo Logging in to Amazon ECR...
129 - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI}
10+ build :
11+ commands :
1312 - PATCH_TAG=${TAG_NAME#"v"}
1413 - MINOR_TAG=${PATCH_TAG%.*}
1514 - MAJOR_TAG=${MINOR_TAG%.*}
16- - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --build-arg ECR_REGION=${ECR_REGION} - t ${FIPS_REPOSITORY_URI}:${PATCH_TAG} -t ${FIPS_REPOSITORY_URI}:${MINOR_TAG} -t ${FIPS_REPOSITORY_URI}:${MAJOR_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} .
1716 - docker image push --all-tags ${FIPS_REPOSITORY_URI}
1817 post_build :
1918 commands :
You can’t perform that action at this time.
0 commit comments