Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 7 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -115,8 +126,10 @@ jobs:
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/hostedtoolcache/CodeQL

if [[ "${image_type}" == "gravitino" || "${image_type}" == "iceberg-rest-server" ]]; then
if [[ "${publish_latest}" == "true" ]]; then
echo "Publish latest tag"
./dev/docker/build-docker.sh --platform all --type ${image_type} --image ${image_name} --tag ${{ github.event.inputs.version }} --latest
else
echo "Doesn't publish latest tag"
./dev/docker/build-docker.sh --platform all --type ${image_type} --image ${image_name} --tag "${tag_name}-${{ github.event.inputs.version }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if...else... is not correct, we should always build the image with tag names, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated with full_tag_name

fi
fi
Binary file removed docs/assets/publish-docker-image.jpg
Binary file not shown.
Binary file added docs/assets/publish-docker-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion docs/publish-docker-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. If you want to update the latest tag, select the box for `Whether to update the latest tag`.
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the sequence number, the number "7" is duplicated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


![Publish Docker image](assets/publish-docker-image.jpg)
![Publish Docker image](assets/publish-docker-image.png)

## More details of Apache Gravitino Docker images

Expand Down
Loading