ci: fix login error for aws ecr
This commit is contained in:
parent
a5a9613512
commit
5d3d4cf85c
|
@ -351,12 +351,22 @@ jobs:
|
||||||
build_machine:
|
build_machine:
|
||||||
- aws-arm64
|
- aws-arm64
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
registry:
|
||||||
|
- docker.io
|
||||||
exclude:
|
exclude:
|
||||||
- arch: arm64
|
- arch: arm64
|
||||||
build_machine: ubuntu-20.04
|
build_machine: ubuntu-20.04
|
||||||
- arch: amd64
|
- arch: amd64
|
||||||
build_machine: aws-arm64
|
build_machine: aws-arm64
|
||||||
include:
|
include:
|
||||||
|
- os: alpine3.14
|
||||||
|
profile: emqx
|
||||||
|
otp: 24.2.1-1
|
||||||
|
elixir: 1.13.3
|
||||||
|
arch: amd64
|
||||||
|
build_elixir: no_elixir
|
||||||
|
build_machine: ubuntu-20.04
|
||||||
|
registry: public.ecr.aws
|
||||||
- os: alpine3.14
|
- os: alpine3.14
|
||||||
profile: emqx
|
profile: emqx
|
||||||
otp: 24.2.1-1
|
otp: 24.2.1-1
|
||||||
|
@ -385,11 +395,22 @@ jobs:
|
||||||
source/deps/quicer/
|
source/deps/quicer/
|
||||||
key: ${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.arch }}-${{ needs.prepare.outputs.DEP_QUICER_REF }}
|
key: ${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.arch }}-${{ needs.prepare.outputs.DEP_QUICER_REF }}
|
||||||
|
|
||||||
- uses: docker/login-action@v1
|
- name: Login for docker.
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
if: matrix.arch == 'amd64' && matrix.registry == 'docker.io'
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USER }}
|
username: ${{ secrets.DOCKER_HUB_USER }}
|
||||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Login for AWS ECR
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
if: matrix.profile == 'emqx' && matrix.arch == 'amd64' && matrix.registry == 'public.ecr.aws'
|
||||||
|
with:
|
||||||
|
registry: public.ecr.aws
|
||||||
|
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
ecr: true
|
||||||
|
|
||||||
- name: prepare for docker-action-parms
|
- name: prepare for docker-action-parms
|
||||||
id: pre-meta
|
id: pre-meta
|
||||||
run: |
|
run: |
|
||||||
|
@ -441,29 +462,6 @@ jobs:
|
||||||
file: source/deploy/docker/Dockerfile
|
file: source/deploy/docker/Dockerfile
|
||||||
context: source
|
context: source
|
||||||
|
|
||||||
- uses: aws-actions/configure-aws-credentials@v1
|
|
||||||
if: matrix.profile == 'emqx' && matrix.arch == 'amd64'
|
|
||||||
with:
|
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
|
|
||||||
|
|
||||||
- name: Login to Amazon ECR
|
|
||||||
if: matrix.profile == 'emqx' && matrix.arch == 'amd64'
|
|
||||||
id: login-ecr
|
|
||||||
uses: aws-actions/amazon-ecr-login@v1
|
|
||||||
with:
|
|
||||||
registries: "public.ecr.aws"
|
|
||||||
|
|
||||||
- name: Docker push to aws ecr
|
|
||||||
if: matrix.profile == 'emqx' && matrix.arch == 'amd64' && startsWith(github.ref, 'refs/tags/')
|
|
||||||
run: |
|
|
||||||
for tag in $(echo ${{ steps.meta.outputs.json }} | jq -c '.tags[]'); do
|
|
||||||
docker pull "$tag"
|
|
||||||
docker tag "$tag" "${{ steps.login-ecr.outputs.registry }}/$tag"
|
|
||||||
docker push "${{ steps.login-ecr.outputs.registry }}/$tag"
|
|
||||||
done
|
|
||||||
|
|
||||||
docker-push-multi-arch-manifest:
|
docker-push-multi-arch-manifest:
|
||||||
# note, we only run on amd64
|
# note, we only run on amd64
|
||||||
if: >
|
if: >
|
||||||
|
@ -494,12 +492,22 @@ jobs:
|
||||||
build_machine:
|
build_machine:
|
||||||
- aws-arm64
|
- aws-arm64
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
registries:
|
||||||
|
- docker.io
|
||||||
exclude:
|
exclude:
|
||||||
- arch: arm64
|
- arch: arm64
|
||||||
build_machine: ubuntu-20.04
|
build_machine: ubuntu-20.04
|
||||||
- arch: amd64
|
- arch: amd64
|
||||||
build_machine: aws-arm64
|
build_machine: aws-arm64
|
||||||
include:
|
include:
|
||||||
|
- os: alpine3.14
|
||||||
|
profile: emqx
|
||||||
|
otp: 24.2.1-1
|
||||||
|
elixir: 1.13.3
|
||||||
|
arch: amd64
|
||||||
|
build_elixir: no_elixir
|
||||||
|
build_machine: ubuntu-20.04
|
||||||
|
registry: public.ecr.aws
|
||||||
- os: alpine3.14
|
- os: alpine3.14
|
||||||
profile: emqx
|
profile: emqx
|
||||||
otp: 24.2.1-1
|
otp: 24.2.1-1
|
||||||
|
@ -507,6 +515,7 @@ jobs:
|
||||||
arch: amd64
|
arch: amd64
|
||||||
build_elixir: with_elixir
|
build_elixir: with_elixir
|
||||||
build_machine: ubuntu-20.04
|
build_machine: ubuntu-20.04
|
||||||
|
registry: docker.io
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v2
|
||||||
|
@ -520,11 +529,19 @@ jobs:
|
||||||
run: unzip -q source.zip
|
run: unzip -q source.zip
|
||||||
|
|
||||||
- uses: docker/login-action@v1
|
- uses: docker/login-action@v1
|
||||||
if: matrix.arch == 'amd64'
|
if: matrix.arch == 'amd64' && matrix.registry == 'docker.io'
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USER }}
|
username: ${{ secrets.DOCKER_HUB_USER }}
|
||||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
|
|
||||||
|
- uses: docker/login-action@v1
|
||||||
|
if: matrix.profile == 'emqx' && matrix.arch == 'amd64' && matrix.registry == 'public.ecr.aws'
|
||||||
|
with:
|
||||||
|
registry: public.ecr.aws
|
||||||
|
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
ecr: true
|
||||||
|
|
||||||
- name: prepare for docker-action-parms
|
- name: prepare for docker-action-parms
|
||||||
id: pre-meta
|
id: pre-meta
|
||||||
run: |
|
run: |
|
||||||
|
@ -567,26 +584,6 @@ jobs:
|
||||||
IsPushLatest=${{ github.event_name == 'release' && !github.event.release.prerelease }};
|
IsPushLatest=${{ github.event_name == 'release' && !github.event.release.prerelease }};
|
||||||
scripts/docker-create-push-manifests.sh "${{ steps.meta.outputs.tags }}" "$IsPushLatest"
|
scripts/docker-create-push-manifests.sh "${{ steps.meta.outputs.tags }}" "$IsPushLatest"
|
||||||
|
|
||||||
- uses: aws-actions/configure-aws-credentials@v1
|
|
||||||
if: matrix.profile == 'emqx' && matrix.arch == 'amd64'
|
|
||||||
with:
|
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
|
|
||||||
|
|
||||||
- name: Login to Amazon ECR
|
|
||||||
if: matrix.profile == 'emqx' && matrix.arch == 'amd64'
|
|
||||||
id: login-ecr
|
|
||||||
uses: aws-actions/amazon-ecr-login@v1
|
|
||||||
with:
|
|
||||||
registries: "public.ecr.aws"
|
|
||||||
|
|
||||||
- name: Docker push to aws ecr
|
|
||||||
if: matrix.profile == 'emqx' && matrix.arch == 'amd64' && startsWith(github.ref, 'refs/tags/')
|
|
||||||
run: |
|
|
||||||
IsPushLatest=${{ github.event_name == 'release' && !github.event.release.prerelease }};
|
|
||||||
scripts/docker-create-push-manifests.sh "${{ steps.login-ecr.outputs.registry }}/${{ steps.meta.outputs.tags }}" "$IsPushLatest"
|
|
||||||
|
|
||||||
upload:
|
upload:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue