Skip to content

Commit

Permalink
pull latest image and push to new release
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed Oct 17, 2023
1 parent a56e486 commit 9b77282
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 2 deletions.
33 changes: 32 additions & 1 deletion .github/workflows/create-channel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ jobs:
- rhel8-x64
- opensuse-leap
- fedora-34-x64
- raspbian-bullseye
- alpine-3.16-x64
- alpine-3.16-x86
- alpine-3.16-arm64
Expand Down Expand Up @@ -124,3 +123,35 @@ jobs:
run: |
export IMAGE_TAG=${{ steps.tag.outputs.release_tag }}
docker push ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:$IMAGE_TAG
# The job will directly pull the image from the latest, and push to the new tag.
# This job is only for a temporary fix. The cheated image would not get updated.
cheated-images:
name: ${{ matrix.variant }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
variant:
- raspbian-bullseye

steps:
- name: Checkout Sources
uses: actions/checkout@v4

- name: Get release tag
uses: ./.github/actions/release-tag
id: tag

- name: Login to docker repo
run: aws ecr get-login-password --region us-east-1 | docker login ${{ secrets.AWS_ECR_REPO }} -u AWS --password-stdin

- name: Pull latest image and push
run: |
if ! aws --region us-east-1 ecr describe-repositories --repository-names aws-crt-${{ matrix.variant }} > /dev/null 2>&1; then \
exit 1
fi
export IMAGE_TAG=${{ steps.tag.outputs.release_tag }}
docker pull ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:latest
docker tag ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:latest ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:$IMAGE_TAG
docker push ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:$IMAGE_TAG
33 changes: 32 additions & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ jobs:
- rhel8-x64
- opensuse-leap
- fedora-34-x64
- raspbian-bullseye
- alpine-3.16-x64
- alpine-3.16-x86
- alpine-3.16-arm64
Expand Down Expand Up @@ -130,6 +129,38 @@ jobs:
| aws s3 cp - s3://${{env.AWS_S3_BUCKET}}/releases/$IMAGE_TAG/aws-crt-${{ matrix.variant }}.tar.gz
aws s3 cp s3://${{env.AWS_S3_BUCKET}}/releases/$IMAGE_TAG/aws-crt-${{ matrix.variant }}.tar.gz s3://${{env.AWS_S3_BUCKET}}/LATEST/aws-crt-${{ matrix.variant }}.tar.gz
# The job will directly pull the image from the latest, and push to the new tag.
# This job is only for a temporary fix. The image would not get updated.
cheat-images:
name: ${{ matrix.variant }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
variant:
- raspbian-bullseye

steps:
- name: Checkout Sources
uses: actions/checkout@v4

- name: Get release tag
uses: ./.github/actions/release-tag
id: tag

- name: Login to docker repo
run: aws ecr get-login-password --region us-east-1 | docker login ${{ secrets.AWS_ECR_REPO }} -u AWS --password-stdin

- name: Pull latest image and push
run: |
if ! aws --region us-east-1 ecr describe-repositories --repository-names aws-crt-${{ matrix.variant }} > /dev/null 2>&1; then \
exit 1
fi
export IMAGE_TAG=${{ steps.tag.outputs.release_tag }}
docker pull ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:latest
docker tag ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:latest ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:$IMAGE_TAG
docker push ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:$IMAGE_TAG
upload-ci-script:
name: Upload container ci script
runs-on: ubuntu-latest
Expand Down

0 comments on commit 9b77282

Please sign in to comment.