Skip to content

Commit

Permalink
refactor: rename dockerhub repo
Browse files Browse the repository at this point in the history
Signed-off-by: Kami Wan <[email protected]>
  • Loading branch information
KaimingWan authored and Kami Wan committed May 7, 2024
1 parent 4663443 commit 65a00d1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
30 changes: 25 additions & 5 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
name: Docker Release

#on:
# push:
# tags:
# - '[0-9]+.[0-9]+.[0-9]+'
# - '[0-9]+.[0-9]+.[0-9]+-rc[0-9]+'

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-rc[0-9]+'
workflow_dispatch:
inputs:
is_release:
description: 'EnableTrigger'
required: true
default: false
type: boolean


jobs:
docker-release:
Expand Down Expand Up @@ -40,6 +50,16 @@ jobs:
- name: Cp TarGz to Docker Path
run: |
cp ./core/build/distributions/automq-${{ github.ref_name }}_kafka-${{ steps.get_project_version.outputs.PROJECT_VERSION }}.tgz ./docker/
- name: Determine Image Tags
id: image_tags
run: |
LATEST_TAG=$(git fetch --tags && git tag --sort=-v:refname | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1)
echo "LATEST_TAG=${LATEST_TAG}"
if [ "$LATEST_TAG" == "${{ github.ref_name }}" ]; then
echo "tags=${{ secrets.DOCKERHUB_USERNAME }}/automq:${{ github.ref_name }}, ${{ secrets.DOCKERHUB_USERNAME }}/automq:latest" >> $GITHUB_OUTPUT
else
echo "tags=${{ secrets.DOCKERHUB_USERNAME }}/automq:${{ github.ref_name }}" >> $GITHUB_OUTPUT
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand All @@ -54,5 +74,5 @@ jobs:
with:
context: ./docker
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/kafka:${{ github.ref_name }}
tags: ${{ steps.image_tags.outputs.tags }}
platforms: linux/amd64,linux/arm64
2 changes: 1 addition & 1 deletion automq_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def do_release(tag, s3stream_tag):
cmd(f"Checking out to release branch", f'git checkout --quiet -b {new_branch}')

print("Updating docker compose")
regexReplace("docker/docker-compose.yaml", "image: automqinc/kafka:.*$", f"image: automqinc/kafka:{tag}")
regexReplace("docker/docker-compose.yaml", "image: automqinc/automq:.*$", f"image: automqinc/automq:{tag}")
replace("gradle/dependencies.gradle", ' branch = "main"', f' require "{s3stream_tag}"')

cmd("Committing changes", ["git", "commit", "--all", "--gpg-sign", "--signoff", "--message", f"ci: bump version to {tag}"])
Expand Down
6 changes: 3 additions & 3 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ services:
container_name: "${CONTROLLER_DOCKER_NAME-controller}"
hostname: "${CONTROLLER_DOCKER_NAME-controller}"
stop_grace_period: 2m
image: automqinc/kafka:1.1.0-rc0
image: automqinc/automq:1.1.0-rc0
environment:
- KAFKA_S3_ACCESS_KEY=test
- KAFKA_S3_SECRET_KEY=test
Expand All @@ -73,7 +73,7 @@ services:
container_name: "${BROKER1_DOCKER_NAME-broker1}"
hostname: "${BROKER1_DOCKER_NAME-broker1}"
stop_grace_period: 2m
image: automqinc/kafka:1.1.0-rc0
image: automqinc/automq:1.1.0-rc0
ports:
- "9094:9094"
environment:
Expand Down Expand Up @@ -103,7 +103,7 @@ services:
container_name: "${BROKER2_DOCKER_NAME-broker2}"
hostname: "${BROKER2_DOCKER_NAME-broker2}"
stop_grace_period: 2m
image: automqinc/kafka:1.1.0-rc0
image: automqinc/automq:1.1.0-rc0
ports:
- "9095:9095"
environment:
Expand Down
4 changes: 2 additions & 2 deletions docker/docker_manage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ docker_push() {
done
prepare
echo_and_do docker buildx build --platform linux/amd64,linux/arm64 \
-t "automqinc/kafka:${kafka_version}" \
-t "automqinc/automq:${kafka_version}" \
. --push
}

Expand All @@ -131,7 +131,7 @@ docker_build() {
esac
done
prepare
echo_and_do docker build -t "automqinc/kafka:${kafka_version}" .
echo_and_do docker build -t "automqinc/automq:${kafka_version}" .
# --build-arg "general_mirror_url=mirrors.ustc.edu.cn" .

}
Expand Down

0 comments on commit 65a00d1

Please sign in to comment.