Compare commits

..

5 Commits

Author SHA1 Message Date
Xinwei Xiong(cubxxw-openim) c9e552ccdb fix: cicd bug
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
2023-07-13 22:17:24 +08:00
Xinwei Xiong(cubxxw-openim) 7770628fd8 fix: cicd bug
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
2023-07-13 22:09:38 +08:00
Xinwei Xiong(cubxxw-openim) f36a040478 fix: docker compose and release
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
2023-07-13 22:00:55 +08:00
Xinwei Xiong(cubxxw-openim) 19bb11ef7a fix: fix bug
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
2023-07-13 21:58:31 +08:00
Xinwei Xiong(cubxxw-openim) db400d27be fix: scripts and release
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
2023-07-13 21:53:28 +08:00
6 changed files with 48 additions and 43 deletions
+12 -8
View File
@@ -28,28 +28,33 @@ jobs:
- name: Start Docker Compose
run: |
docker-compose stop
docker-compose up -d
docker compose stop
sleep 30
docker compose up -d
sleep 60
continue-on-error: true
- name: Stop all services
run: |
chmod +x ./scripts/stop_all.sh
./scripts/stop_all.sh
cat logs/openIM.log 2>/dev/null
shell: bash
continue-on-error: true
- name: Build all services
run: |
chmod +x ./scripts/build_all_service.sh
./scripts/build_all_service.sh
cat logs/openIM.log
cat logs/openIM.log 2>/dev/null
shell: bash
continue-on-error: true
- name: Start all services
run: |
chmod +x ./scripts/start_all.sh
./scripts/start_all.sh
cat logs/openIM.log
cat logs/openIM.log 2>/dev/null
continue-on-error: true
shell: bash
@@ -57,13 +62,12 @@ jobs:
run: |
chmod +x ./scripts/check_all.sh
./scripts/check_all.sh
cat logs/openIM.log
cat logs/openIM.log 2>/dev/null
shell: bash
continue-on-error: true
- name: Print openIM.log
run: |
cat logs/openIM.log
cat logs/openIM.log >> "$GITHUB_OUTPUT"
cat logs/* 2>/dev/null
cat logs/* 2>/dev/null >> "$GITHUB_OUTPUT"
shell: bash
continue-on-error: true
+3 -7
View File
@@ -1,9 +1,5 @@
# Build Stage
FROM golang:1.20 AS builder
LABEL org.opencontainers.image.source=https://github.com/OpenIMSDK/Open-IM-Server
LABEL org.opencontainers.image.description="OpenIM Server image"
LABEL org.opencontainers.image.licenses="Apache 2.0"
FROM golang as build
# Set go mod installation source and proxy
ARG GO111MODULE=on
@@ -28,8 +24,8 @@ RUN apk --no-cache add tzdata
VOLUME ["/Open-IM-Server/logs", "/Open-IM-Server/config", "/Open-IM-Server/scripts", "/Open-IM-Server/db/sdk"]
# Copy scripts and binary files to the production image
COPY --from=builder /Open-IM-Server/scripts /Open-IM-Server/scripts
COPY --from=builder /Open-IM-Server/_output/bin/platforms/linux/amd64 /Open-IM-Server/_output/bin/platforms/linux/amd64
COPY --from=build /Open-IM-Server/scripts /Open-IM-Server/scripts
COPY --from=build /Open-IM-Server/_output/bin/platforms/linux/arm64 /Open-IM-Server/_output/bin/platforms/linux/arm64
WORKDIR /Open-IM-Server/scripts
+1 -1
View File
@@ -100,7 +100,7 @@ services:
openim_server:
image: ghcr.io/openimsdk/openim-server:v3.0.0-alpha.1
image: ghcr.io/openimsdk/openim-server:v3.0.0-rc.2
container_name: openim-server
volumes:
- ./logs:/Open-IM-Server/logs
+27 -22
View File
@@ -18,25 +18,35 @@
# ==============================================================================
# Path: scripts/make-rules/image.mk
# docker registry: registry.example.com/namespace/image:tag as: registry.hub.docker.com/cubxxw/<image-name>:<tag>
# https://docs.docker.com/build/building/multi-platform/
#
# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
# - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=<myregistry/image:<tag>> then the export will fail)
# To properly provided solutions that supports more than one platform you should use this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: test ## Build and push docker image for the manager for cross-platform support
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
- docker buildx create --name project-v3-builder
docker buildx use project-v3-builder
- docker buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
- docker buildx rm project-v3-builder
rm Dockerfile.cross
# # If you wish built the manager image targeting other platforms you can use the --platform flag.
# # (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
# # More info: https://docs.docker.com/develop/develop-images/build_enhancements/
# .PHONY: docker-build
# docker-build: test ## Build docker image with the manager.
# docker build -t ${IMG} .
# .PHONY: docker-push
# docker-push: ## Push docker image with the manager.
# docker push ${IMG}
# # PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
# # architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
# # - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
# # - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
# # - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=<myregistry/image:<tag>> then the export will fail)
# # To properly provided solutions that supports more than one platform you should use this option.
# PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
# .PHONY: docker-buildx
# docker-buildx: test ## Build and push docker image for the manager for cross-platform support
# # copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
# sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
# - docker buildx create --name project-v3-builder
# docker buildx use project-v3-builder
# - docker buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
# - docker buildx rm project-v3-builder
# rm Dockerfile.cross
DOCKER := docker
DOCKER_SUPPORTED_API_VERSION ?= 1.32|1.40|1.41
@@ -88,9 +98,6 @@ image.daemon.verify:
exit 1; \
fi
# If you wish built the manager image targeting other platforms you can use the --platform flag.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
## image.build: Build docker images
.PHONY: image.build
image.build: image.verify go.build.verify $(addprefix image.build., $(addprefix $(IMAGE_PLAT)., $(IMAGES)))
@@ -119,8 +126,6 @@ image.build.%: go.build.%
fi
@rm -rf $(TMP_DIR)/$(IMAGE)
# https://docs.docker.com/build/building/multi-platform/
# busybox image supports amd64, arm32v5, arm32v6, arm32v7, arm64v8, i386, ppc64le, and s390x
## image.buildx.%: Build docker images with buildx
.PHONY: image.buildx.%
image.buildx.%:
-5
View File
@@ -22,11 +22,6 @@ source $SCRIPTS_ROOT/style_info.sh
source $SCRIPTS_ROOT/path_info.sh
source $SCRIPTS_ROOT/function.sh
cd $SCRIPTS_ROOT
chmod +x build_all_service.sh
./build_all_service.sh
echo -e "${YELLOW_PREFIX}=======>SCRIPTS_ROOT=$SCRIPTS_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>OPENIM_ROOT=$OPENIM_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>pwd=$PWD${COLOR_SUFFIX}"
+5
View File
@@ -27,6 +27,11 @@ source $SCRIPTS_ROOT/function.sh
cd $SCRIPTS_ROOT
if [ ! -d "${OPENIM_ROOT}/_output/bin/platforms" ]; then
# exec build_all_service.sh
"${SCRIPTS_ROOT}/build_all_service.sh"
fi
echo -e "${YELLOW_PREFIX}=======>SCRIPTS_ROOT=$SCRIPTS_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>OPENIM_ROOT=$OPENIM_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>pwd=$PWD${COLOR_SUFFIX}"