This is an automated email from the ASF dual-hosted git repository.

fanng pushed a commit to branch branch-0.8
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/branch-0.8 by this push:
     new e2cf21d56 [#6300] fix(workflow):  add an flag to control whether 
update docker latest tag. (#6322)
e2cf21d56 is described below

commit e2cf21d569d4ae9511c7c50e31a72f008d3b69b0
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Jan 17 21:07:15 2025 +0800

    [#6300] fix(workflow):  add an flag to control whether update docker latest 
tag. (#6322)
    
    ### 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
    
    Co-authored-by: FANNG <xiaoj...@datastrato.com>
---
 .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 e5f1f699d..337504170 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 ca22da1db..000000000
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 000000000..8085d2dc7
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 953d31206..d4590205c 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.
 
-![Publish Docker image](assets/publish-docker-image.jpg)
+![Publish Docker image](assets/publish-docker-image.png)
 
 ## More details of Apache Gravitino Docker images
 

Reply via email to