mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 14:29:19 +08:00
* feat: Add light mode and dark mode.(#89) Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * fix: make file code len Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: fix scripts support win Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * fix: make build issue Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * fix: golint and format Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add scripts sudo limits of authority Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * fix: docker images fix Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * fix: docker images fix Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --------- Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
@@ -57,10 +57,18 @@ ifeq (${BINS},)
|
||||
$(error Could not determine BINS, set ROOT_DIR or run in source dir)
|
||||
endif
|
||||
|
||||
ifeq (${COMMANDS},)
|
||||
ifeq ($(OS),Windows_NT)
|
||||
NULL :=
|
||||
SPACE := $(NULL) $(NULL)
|
||||
ROOT_DIR := $(subst $(SPACE),\$(SPACE),$(shell cd))
|
||||
else
|
||||
ROOT_DIR := $(shell pwd)
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(COMMANDS)),)
|
||||
$(error Could not determine COMMANDS, set ROOT_DIR or run in source dir)
|
||||
endif
|
||||
ifeq (${BINS},)
|
||||
ifeq ($(strip $(BINS)),)
|
||||
$(error Could not determine BINS, set ROOT_DIR or run in source dir)
|
||||
endif
|
||||
|
||||
@@ -161,7 +169,7 @@ go.format: tools.verify.golines tools.verify.goimports
|
||||
@echo "===========> Formating codes"
|
||||
@$(FIND) -type f -name '*.go' | $(XARGS) gofmt -s -w
|
||||
@$(FIND) -type f -name '*.go' | $(XARGS) $(TOOLS_DIR)/goimports -w -local $(ROOT_PACKAGE)
|
||||
@$(FIND) -type f -name '*.go' | $(XARGS) $(TOOLS_DIR)/golines -w --max-len=120 --reformat-tags --shorten-comments --ignore-generated .
|
||||
@$(FIND) -type f -name '*.go' | $(XARGS) $(TOOLS_DIR)/golines -w --max-len=200 --reformat-tags --shorten-comments --ignore-generated .
|
||||
@$(GO) mod edit -fmt
|
||||
|
||||
## imports: task to automatically handle import packages in Go files using goimports tool
|
||||
@@ -184,4 +192,4 @@ go.clean:
|
||||
## copyright.help: Show copyright help
|
||||
.PHONY: go.help
|
||||
go.help: scripts/make-rules/golang.mk
|
||||
$(call smallhelp)
|
||||
$(call smallhelp)
|
||||
+22
-27
@@ -18,35 +18,25 @@
|
||||
# ==============================================================================
|
||||
# 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/
|
||||
#
|
||||
|
||||
# # 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
|
||||
# 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
|
||||
@@ -98,6 +88,9 @@ 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)))
|
||||
@@ -126,6 +119,8 @@ 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.%:
|
||||
|
||||
Reference in New Issue
Block a user