You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by ro...@apache.org on 2025/01/23 03:08:14 UTC
(gravitino) 25/37: [#6300] fix(workflow): add an flag to control whether update docker latest tag. (#6318)
This is an automated email from the ASF dual-hosted git repository.
roryqi pushed a commit to branch ISSUE-6353
in repository https://gitbox.apache.org/repos/asf/gravitino.git
commit f65e5e93311b9794f6f843ec78f8f6bf63b046a8
Author: FANNG <xi...@datastrato.com>
AuthorDate: Fri Jan 17 20:10:48 2025 +0800
[#6300] fix(workflow): add an flag to control whether update docker latest tag. (#6318)
### What changes were proposed in this pull request?
add an flag to control whether update docker latest tag.
<img width="336" alt="image"
src="https://github.com/user-attachments/assets/dc2b122a-b1bf-4e42-9f90-717ac6cd55ef"
/>
### Why are the changes needed?
Fix: #6300
### Does this PR introduce _any_ user-facing change?
no
### How was this patch tested?
test in whether update latest tag
---
.github/workflows/docker-image.yml | 27 +++++++++++++++++++++++----
docs/assets/publish-docker-image.jpg | Bin 539255 -> 0 bytes
docs/assets/publish-docker-image.png | Bin 0 -> 94355 bytes
docs/publish-docker-images.md | 5 +++--
4 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml
index e5f1f699de..337504170c 100644
--- a/.github/workflows/docker-image.yml
+++ b/.github/workflows/docker-image.yml
@@ -32,6 +32,11 @@ on:
description: 'Publish Docker token'
required: true
type: string
+ publish-latest-tag:
+ description: 'Whether to update the latest tag. This operation is only applicable to official releases and should not be used for Release Candidate (RC).'
+ required: false
+ type: boolean
+ default: false
jobs:
publish-docker-image:
@@ -83,6 +88,12 @@ jobs:
echo "image_type=iceberg-rest-server" >> $GITHUB_ENV
echo "image_name=apache/gravitino-iceberg-rest" >> $GITHUB_ENV
fi
+
+ if [ "${{ github.event.inputs.publish-latest-tag }}" == "true" ]; then
+ echo "publish_latest=true" >> $GITHUB_ENV
+ else
+ echo "publish_latest=false" >> $GITHUB_ENV
+ fi
- name: Check publish Docker token
run: |
@@ -115,8 +126,16 @@ jobs:
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/hostedtoolcache/CodeQL
- if [[ "${image_type}" == "gravitino" || "${image_type}" == "iceberg-rest-server" ]]; then
- ./dev/docker/build-docker.sh --platform all --type ${image_type} --image ${image_name} --tag ${{ github.event.inputs.version }} --latest
+ if [[ -n "${tag_name}" ]]; then
+ full_tag_name="${tag_name}-${{ github.event.inputs.version }}"
+ else
+ full_tag_name="${{ github.event.inputs.version }}"
+ fi
+
+ if [[ "${publish_latest}" == "true" ]]; then
+ echo "Publish tag ${full_tag_name}, and update latest too."
+ ./dev/docker/build-docker.sh --platform all --type ${image_type} --image ${image_name} --tag ${full_tag_name} --latest
else
- ./dev/docker/build-docker.sh --platform all --type ${image_type} --image ${image_name} --tag "${tag_name}-${{ github.event.inputs.version }}"
- fi
\ No newline at end of file
+ echo "Publish tag ${full_tag_name}."
+ ./dev/docker/build-docker.sh --platform all --type ${image_type} --image ${image_name} --tag ${full_tag_name}
+ fi
diff --git a/docs/assets/publish-docker-image.jpg b/docs/assets/publish-docker-image.jpg
deleted file mode 100644
index ca22da1db9..0000000000
Binary files a/docs/assets/publish-docker-image.jpg and /dev/null differ
diff --git a/docs/assets/publish-docker-image.png b/docs/assets/publish-docker-image.png
new file mode 100644
index 0000000000..8085d2dc7d
Binary files /dev/null and b/docs/assets/publish-docker-image.png differ
diff --git a/docs/publish-docker-images.md b/docs/publish-docker-images.md
index 953d312066..d4590205ce 100644
--- a/docs/publish-docker-images.md
+++ b/docs/publish-docker-images.md
@@ -30,9 +30,10 @@ You can use GitHub actions to publish Docker images to the Docker Hub repository
3. `apache/gravitino:0.1.0` if this is a gravitino server image.
4. `apache/gravitino-iceberg-rest:0.1.0` if this is an iceberg-rest server image.
6. You must enter the correct `docker user name`and `publish docker token` before you can execute run `Publish Docker Image` workflow.
-7. Wait for the workflow to complete. You can see a new Docker image shown in the [Apache Docker Hub](https://hub.docker.com/u/apache) repository.
+7. If you want to update the latest tag, select the box for `Whether to update the latest tag`.
+8. Wait for the workflow to complete. You can see a new Docker image shown in the [Apache Docker Hub](https://hub.docker.com/u/apache) repository.
-
+
## More details of Apache Gravitino Docker images