Skip to content

Commit 7c7a99f

Browse files
authored
build: update kubernetes deployment Run. (#2919)
* build: k8s improve. * refactor: update docker image contents. * rename seq file. * build: update k8s origin deploys. * update check logic. * update magefile * update image name. * update readme * update Kubernetes Discovery. * revert pkg. * update create in k8s * update service image release CI. * update deployment image source. * update mage contents. * update pkg source. * update go get pkg. * fix test file. * update discovery register. * update * update deploy yaml. * update replica. * update deployment. * remove notfication config. * remove notification and zookeeper. * update discovery in kubernetes. * build: improve kubernetes deployment. * update config field in discovery. * update ReadMe in deployments. * update go mod. * update const quote. * fix test fields. * remove unused method. * remove unused contents.
1 parent 1eaae5f commit 7c7a99f

File tree

192 files changed

+2517
-7894
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+2517
-7894
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Build and release services Docker Images
2+
3+
on:
4+
push:
5+
branches:
6+
- release-*
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
inputs:
11+
tag:
12+
description: "Tag version to be used for Docker image"
13+
required: true
14+
default: "v3.8.3"
15+
16+
jobs:
17+
build-and-push:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v3
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v2
26+
27+
- name: Log in to Docker Hub
28+
uses: docker/login-action@v2
29+
with:
30+
username: ${{ secrets.DOCKER_USERNAME }}
31+
password: ${{ secrets.DOCKER_PASSWORD }}
32+
33+
- name: Log in to GitHub Container Registry
34+
uses: docker/login-action@v2
35+
with:
36+
registry: ghcr.io
37+
username: ${{ github.repository_owner }}
38+
password: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Log in to Aliyun Container Registry
41+
uses: docker/login-action@v2
42+
with:
43+
registry: registry.cn-hangzhou.aliyuncs.com
44+
username: ${{ secrets.ALIREGISTRY_USERNAME }}
45+
password: ${{ secrets.ALIREGISTRY_TOKEN }}
46+
47+
- name: Extract metadata for Docker (tags, labels)
48+
id: meta
49+
uses: docker/metadata-action@v5
50+
with:
51+
tags: |
52+
type=ref,event=tag
53+
type=schedule
54+
type=ref,event=branch
55+
type=semver,pattern={{version}}
56+
type=semver,pattern=v{{version}}
57+
# type=semver,pattern={{major}}.{{minor}}
58+
type=semver,pattern=release-{{raw}}
59+
type=sha
60+
type=raw,value=${{ github.event.inputs.tag }}
61+
62+
- name: Build and push Docker images
63+
run: |
64+
ROOT_DIR="build/images"
65+
for dir in "$ROOT_DIR"/*/; do
66+
# Find Dockerfile or *.dockerfile in a case-insensitive manner
67+
dockerfile=$(find "$dir" -maxdepth 1 -type f \( -iname 'dockerfile' -o -iname '*.dockerfile' \) | head -n 1)
68+
69+
if [ -n "$dockerfile" ] && [ -f "$dockerfile" ]; then
70+
IMAGE_NAME=$(basename "$dir")
71+
echo "Building Docker image for $IMAGE_NAME with tags:"
72+
73+
# Initialize tag arguments
74+
tag_args=()
75+
76+
# Read each tag and append --tag arguments
77+
while IFS= read -r tag; do
78+
tag_args+=(--tag "${{ secrets.DOCKER_USERNAME }}/$IMAGE_NAME:$tag")
79+
tag_args+=(--tag "ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:$tag")
80+
tag_args+=(--tag "registry.cn-hangzhou.aliyuncs.com/openimsdk/$IMAGE_NAME:$tag")
81+
done <<< "${{ steps.meta.outputs.tags }}"
82+
83+
# Build and push the Docker image with all tags
84+
docker buildx build --platform linux/amd64,linux/arm64 \
85+
--file "$dockerfile" \
86+
"${tag_args[@]}" \
87+
--push "$dir"
88+
else
89+
echo "No valid Dockerfile found in $dir"
90+
fi
91+
done

build/images/openim-crontask/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output
3636
# COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config
3737

3838
# Set the command to run when the container starts
39-
ENTRYPOINT ["sh", "-c", "_output/openim-crontask"]
39+
ENTRYPOINT ["sh", "-c", "_output/openim-crontask"]

build/images/openim-msggateway/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output
3636
# COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config
3737

3838
# Set the command to run when the container starts
39-
ENTRYPOINT ["sh", "-c", "_output/openim-msggateway"]
39+
ENTRYPOINT ["sh", "-c", "_output/openim-msggateway"]

build/images/openim-msgtransfer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output
3636
# COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config
3737

3838
# Set the command to run when the container starts
39-
ENTRYPOINT ["sh", "-c", "_output/openim-msgtransfer"]
39+
ENTRYPOINT ["sh", "-c", "_output/openim-msgtransfer"]

build/images/openim-push/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output
3636
# COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config
3737

3838
# Set the command to run when the container starts
39-
ENTRYPOINT ["sh", "-c", "_output/openim-push"]
39+
ENTRYPOINT ["sh", "-c", "_output/openim-push"]

build/images/openim-rpc-auth/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output
3636
# COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config
3737

3838
# Set the command to run when the container starts
39-
ENTRYPOINT ["sh", "-c", "_output/openim-rpc-auth"]
39+
ENTRYPOINT ["sh", "-c", "_output/openim-rpc-auth"]

build/images/openim-rpc-conversation/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output
3636
# COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config
3737

3838
# Set the command to run when the container starts
39-
ENTRYPOINT ["sh", "-c", "_output/openim-rpc-conversation"]
39+
ENTRYPOINT ["sh", "-c", "_output/openim-rpc-conversation"]

build/images/openim-rpc-friend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output
3636
# COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config
3737

3838
# Set the command to run when the container starts
39-
ENTRYPOINT ["sh", "-c", "_output/openim-rpc-friend"]
39+
ENTRYPOINT ["sh", "-c", "_output/openim-rpc-friend"]

build/images/openim-rpc-group/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output
3636
# COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config
3737

3838
# Set the command to run when the container starts
39-
ENTRYPOINT ["sh", "-c", "_output/openim-rpc-group"]
39+
ENTRYPOINT ["sh", "-c", "_output/openim-rpc-group"]

build/images/openim-rpc-msg/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output
3636
# COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config
3737

3838
# Set the command to run when the container starts
39-
ENTRYPOINT ["sh", "-c", "_output/openim-rpc-msg"]
39+
ENTRYPOINT ["sh", "-c", "_output/openim-rpc-msg"]

0 commit comments

Comments
 (0)