-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yuriy Bezsonov
committed
Sep 13, 2023
1 parent
37b67ba
commit 1d9c3d6
Showing
4 changed files
with
163 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
manifests/modules/automation/gitops/flux/buildspec-manifest.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
install: | ||
commands: | ||
- echo Build started on `date` | ||
pre_build: | ||
commands: | ||
- echo Logging in to Amazon ECR in $AWS_REGION | ||
- COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-8) | ||
- IMAGE_TAG=i$(date +%Y%m%d%H%M%S)-${COMMIT_HASH:=latest} | ||
- echo ECR_URI=$ECR_URI | ||
- echo COMMIT_HASH=$COMMIT_HASH | ||
- echo IMAGE_TAG=$IMAGE_TAG | ||
- aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $ECR_URI | ||
build: | ||
commands: | ||
- echo Building the Docker manifest... | ||
# Based on the Docker documentation, must include the DOCKER_CLI_EXPERIMENTAL environment variable | ||
# https://docs.docker.com/engine/reference/commandline/manifest/ | ||
- export DOCKER_CLI_EXPERIMENTAL=enabled | ||
- docker manifest create $ECR_URI:$IMAGE_TAG $ECR_URI:latest-arm64 $ECR_URI:latest-amd64 | ||
- docker manifest create $ECR_URI:latest $ECR_URI:latest-arm64 $ECR_URI:latest-amd64 | ||
- docker manifest annotate --arch arm64 $ECR_URI:$IMAGE_TAG $ECR_URI:latest-arm64 | ||
- docker manifest annotate --arch arm64 $ECR_URI:latest $ECR_URI:latest-arm64 | ||
- docker manifest annotate --arch amd64 $ECR_URI:$IMAGE_TAG $ECR_URI:latest-amd64 | ||
- docker manifest annotate --arch amd64 $ECR_URI:latest $ECR_URI:latest-amd64 | ||
|
||
post_build: | ||
commands: | ||
- echo Pushing the Docker image... | ||
- docker manifest push $ECR_URI:$IMAGE_TAG | ||
- docker manifest push $ECR_URI:latest | ||
- docker manifest inspect $ECR_URI:$IMAGE_TAG | ||
- docker manifest inspect $ECR_URI:latest | ||
- echo Build completed on `date` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters