Skip to content

Commit

Permalink
use platform as image tag
Browse files Browse the repository at this point in the history
  • Loading branch information
whhe committed Aug 26, 2024
1 parent ce0ebc7 commit d920094
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/reusable-build-oblogproxy-ce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
- name: Build oblogproxy-ce image
run: |
cd oblogproxy-ce
docker buildx build --build-arg VERSION=${{ inputs.version }} --platform linux/amd64 -t oblogproxy-ce-amd64 --load --output type=docker,dest=./oblogproxy-ce-amd64.tar .
docker buildx build --build-arg VERSION=${{ inputs.version }} --platform linux/arm64 -t oblogproxy-ce-arm64 --load --output type=docker,dest=./oblogproxy-ce-arm64.tar .
docker buildx build --build-arg VERSION=${{ inputs.version }} --platform linux/amd64 -t oblogproxy-ce:amd64 --load --output type=docker,dest=./oblogproxy-ce-amd64.tar .
docker buildx build --build-arg VERSION=${{ inputs.version }} --platform linux/arm64 -t oblogproxy-ce:arm64 --load --output type=docker,dest=./oblogproxy-ce-arm64.tar .
- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-build-oceanbase-ce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ jobs:
- name: Build observer image
run: |
cd oceanbase-ce
docker buildx build --build-arg VERSION=${{ inputs.version }} --platform linux/amd64 -t oceanbase-ce-amd64 --load --output type=docker,dest=./oceanbase-ce-amd64.tar .
docker buildx build --build-arg VERSION=${{ inputs.version }} --platform linux/arm64 -t oceanbase-ce-arm64 --load --output type=docker,dest=./oceanbase-ce-arm64.tar .
docker buildx build --build-arg VERSION=${{ inputs.version }} --platform linux/amd64 -t oceanbase-ce:amd64 --load --output type=docker,dest=./oceanbase-ce-amd64.tar .
docker buildx build --build-arg VERSION=${{ inputs.version }} --platform linux/arm64 -t oceanbase-ce:arm64 --load --output type=docker,dest=./oceanbase-ce-arm64.tar .
- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/reusable-release-oceanbase-ce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,34 +68,34 @@ jobs:
- name: Publish observer images with version tag
run: |
docker buildx imagetools create --dry-run --tag oceanbase-ce oceanbase-ce-amd64 oceanbase-ce-arm64
gh_tag=ghcr.io/${{ github.repository_owner }}/oceanbase-ce:${{ inputs.version }}
docker buildx imagetools create --dry-run --tag $gh_tag oceanbase-ce:amd64 oceanbase-ce:arm64
docker push $gh_tag
docker tag oceanbase-ce ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:${{ inputs.version }}
docker push ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:${{ inputs.version }}
docker tag oceanbase-ce quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:${{ inputs.version }}
docker tag $gh_tag quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:${{ inputs.version }}
docker push quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:${{ inputs.version }}
docker tag oceanbase-ce ghcr.io/${{ github.repository_owner }}/oceanbase-ce:${{ inputs.version }}
docker tag $gh_tag ghcr.io/${{ github.repository_owner }}/oceanbase-ce:${{ inputs.version }}
docker push ghcr.io/${{ github.repository_owner }}/oceanbase-ce:${{ inputs.version }}
- name: Publish observer images with lts tag
if: ${{ inputs.lts }}
run: |
gh_tag=ghcr.io/${{ github.repository_owner }}/oceanbase-ce:${{ inputs.version }}
lts_version=$(echo $tagName | grep -P '(\d*\.\d*\.\d*)' --only-matching)
lts_tag="${lts_version}-lts"
docker tag oceanbase-ce ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:$lts_tag
docker tag oceanbase-ce ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:latest
docker tag $gh_tag ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:$lts_tag
docker tag $gh_tag ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:latest
docker push ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:$lts_tag
docker push ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:latest
docker tag oceanbase-ce quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:$lts_tag
docker tag oceanbase-ce quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:latest
docker tag $gh_tag quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:$lts_tag
docker tag $gh_tag quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:latest
docker push quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:$lts_tag
docker push quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:latest
docker tag oceanbase-ce ghcr.io/${{ github.repository_owner }}/oceanbase-ce:$lts_tag
docker tag oceanbase-ce ghcr.io/${{ github.repository_owner }}/oceanbase-ce:latest
docker tag $gh_tag ghcr.io/${{ github.repository_owner }}/oceanbase-ce:$lts_tag
docker tag $gh_tag ghcr.io/${{ github.repository_owner }}/oceanbase-ce:latest
docker push ghcr.io/${{ github.repository_owner }}/oceanbase-ce:$lts_tag
docker push ghcr.io/${{ github.repository_owner }}/oceanbase-ce:latest
9 changes: 5 additions & 4 deletions .github/workflows/reusable-test-oceanbase-ce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ jobs:
large-packages: true
swap-storage: true

- name: Checkout repository
uses: actions/checkout@v4

- name: Download artifact
uses: actions/download-artifact@v4
with:
Expand All @@ -61,7 +64,8 @@ jobs:
- name: Start Docker container
uses: oceanbase/setup-oceanbase-ce@v1
with:
image_name: oceanbase-ce-amd64
image_name: oceanbase-ce
image_tag: amd64
container_name: oceanbase-ce
mode: ${{ inputs.mode }}
cluster_name: ${{ inputs.cluster_name }}
Expand All @@ -84,9 +88,6 @@ jobs:
echo "server_ip=$container_ip" >> $GITHUB_OUTPUT
fi
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-oblogproxy-ce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
tenant_root_password: 654321

- name: Start oblogproxy-ce container
run: docker run --name oblogproxy-ce -e OB_SYS_USERNAME=root -e OB_SYS_PASSWORD=123456 -p 12983:2983 -d oblogproxy-ce-amd64
run: docker run --name oblogproxy-ce -e OB_SYS_USERNAME=root -e OB_SYS_PASSWORD=123456 -p 12983:2983 -d oblogproxy-ce:amd64

- name: Set container IP
id: set_container_ip
Expand Down

0 comments on commit d920094

Please sign in to comment.