Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#6300] fix(workflow): add an flag to control whether update docker latest tag. (#6318)

FANNG5c9685cbd07c
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.
-![Publish Docker image](assets/publish-docker-image.jpg)
+![Publish Docker image](assets/publish-docker-image.png)
## More details of Apache Gravitino Docker images