-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously, the "main" image was always an amd64 image, and there was a secondary arm64 image that could be used with an explicit tag. This makes the amd64 image also have an explicit tag, and replaces the normal tagged image with a manifest file that will correctly route to the appropriate architecture.
- Loading branch information
Bennett Sala
committed
May 30, 2023
1 parent
fe56781
commit fb0b384
Showing
5 changed files
with
252 additions
and
131 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
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,63 @@ | ||
name: "Push Image" | ||
description: "Deploys the controller image into a given region" | ||
|
||
inputs: | ||
src_host: | ||
description: "URL of the source ECR repository to pull images from" | ||
required: true | ||
src_image_name: | ||
description: "Name of the source image" | ||
default: "amazon/appmesh-controller" | ||
required: false | ||
image_tag: | ||
description: "Root tag of the image to pull and push" | ||
required: true | ||
region: | ||
description: "AWS region to push images to" | ||
required: true | ||
dst_host: | ||
description: "URL of the target ECR repository to push images to" | ||
required: true | ||
dst_image_name: | ||
description: "Name of the destination image" | ||
default: "amazon/appmesh-controller" | ||
required: false | ||
role: | ||
description: "IAM role to assume to perform the deploys" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Configure AWS Credentials For Region | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-region: "${{ inputs.region }}" | ||
role-to-assume: "${{ inputs.role }}" | ||
role-session-name: RegionalImageDeploy | ||
env: | ||
AWS_DEFAULT_REGION: "" | ||
AWS_REGION: "" | ||
AWS_ACCESS_KEY_ID: "" | ||
AWS_SECRET_ACCESS_KEY: "" | ||
AWS_SESSION_TOKEN: "" | ||
|
||
- name: Push Images To Region | ||
shell: bash | ||
env: | ||
SRC: "${{ inputs.src_host }}/${{ inputs.src_image_name }}:${{ inputs.image_tag }}" | ||
DST: "${{ inputs.dst_host }}/${{ inputs.dst_image_name }}:${{ inputs.image_tag }}" | ||
run: | | ||
if [[ "${{ inputs.dst_host }}" =~ "public.ecr.aws" ]]; then | ||
aws ecr-public get-login-password --region "us-east-1" | \ | ||
docker login --username AWS --password-stdin "public.ecr.aws" | ||
else | ||
aws ecr get-login-password --region "${{ inputs.region }}" | \ | ||
docker login --username AWS --password-stdin "${{ inputs.dst_host }}" | ||
fi | ||
docker tag "${SRC}-linux_amd64" "${DST}-linux_amd64" | ||
docker push "${DST}-linux_amd64" | ||
docker tag "${SRC}-linux_arm64" "${DST}-linux_arm64" | ||
docker push "${DST}-linux_arm64" | ||
docker manifest create "$DST" "${DST}-linux_amd64" "${DST}-linux_arm64" | ||
docker manifest push "$DST" |
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
Oops, something went wrong.