File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ version : 0.2
2+ phases :
3+ pre_build :
4+ commands :
5+ - echo Logging in to Amazon ECR...
6+ - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI}
7+ build :
8+ commands :
9+ - echo Building the Docker image...
10+ - docker build -t ${FIPS_REPOSITORY_URI}:latest .
11+ - docker image push --all-tags ${FIPS_REPOSITORY_URI}
12+ post_build :
13+ commands :
14+ - echo Build completed!
Original file line number Diff line number Diff line change 1+ version : 0.2
2+ phases :
3+ build :
4+ commands :
5+ - echo Logging in to Amazon ECR...
6+ - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI}
7+ - export COMMIT_HASH_SHORT="$(echo $COMMIT_HASH | cut -c 1-7)"
8+ - echo Building the Docker image...
9+ - echo $FIPS_REPOSITORY_URI
10+ - echo $COMMIT_HASH_SHORT
11+ - echo $BRANCH_NAME
12+ - docker build --tag ${FIPS_REPOSITORY_URI}:${COMMIT_HASH_SHORT} --tag ${FIPS_REPOSITORY_URI}:${BRANCH_NAME} .
13+ # We have a life cycle policy in place to expire and delete images from dev branches,
14+ # so there are no issues with pushing as many of these images as there may be.
15+ - docker image push --all-tags ${FIPS_REPOSITORY_URI}
16+ post_build :
17+ commands :
18+ - echo Build completed!
19+ - printf '{"tag":"%s"}' $COMMIT_HASH_SHORT > build.json
Original file line number Diff line number Diff line change 1+
2+ version : 0.2
3+ phases :
4+ build :
5+ commands :
6+ - echo Logging in to Amazon ECR...
7+ - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI}
8+ - echo Building the Docker image...
9+ - PATCH_TAG=${TAG_NAME#"v"} # major.minor.patch
10+ - MINOR_TAG=${PATCH_TAG%.*} # major.minor
11+ - MAJOR_TAG=${MINOR_TAG%.*} # major
12+ - docker build -t ${FIPS_REPOSITORY_URI}:${PATCH_TAG} -t ${FIPS_REPOSITORY_URI}:${MINOR_TAG} -t ${FIPS_REPOSITORY_URI}:${MAJOR_TAG} .
13+ - docker image push --all-tags ${FIPS_REPOSITORY_URI}
14+ post_build :
15+ commands :
16+ - echo Build completed!
17+ - printf '{"tag":"%s"}' $TAG_NAME > build.json
You can’t perform that action at this time.
0 commit comments