Skip to content

Commit a7fa813

Browse files
styling
1 parent b2bf51c commit a7fa813

3 files changed

Lines changed: 24 additions & 5 deletions

File tree

buildspec/merge_master.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ phases:
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:

buildspec/push.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff 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:

buildspec/release.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
version: 0.2
32
phases:
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:

0 commit comments

Comments
 (0)