scripts fix change scripts to script, and create dependencies

Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong(cubxxw)
2023-05-11 18:08:45 +08:00
committed by Xinwei Xiong(cubxxw-openim)
parent c85bbe0488
commit b613a045d5
10 changed files with 75 additions and 21 deletions
+2 -2
View File
@@ -31,14 +31,14 @@ endef
# Here are some examples of builds
define MAKEFILE_EXAMPLE
# make build BINS=imctl Only a single imctl binary is built.
# make build BINS=imctl Only a single imctl binary is built.
# make -j $(nproc) all Run tidy gen add-copyright format lint cover build concurrently.
# make gen Generate all necessary files.
# make linux.arm64 imctl is compiled on arm64 platform.
# make verify-copyright Verify the license headers for all files.
# make install-deepcopy-gen Install deepcopy-gen tools if the license is missing.
# make build BINS=imctl V=1 DEBUG=1 Build debug binaries for only imctl.
# make build.multiarch PLATFORMS="linux_arm64 linux_amd64" V=1 Build binaries for both platforms.
# make multiarch PLATFORMS="linux_arm64 linux_amd64" V=1 Build binaries for both platforms.
endef
export MAKEFILE_EXAMPLE
+2 -2
View File
@@ -17,7 +17,7 @@
# Makefile helper functions for copyright
#
LICENSE_TEMPLATE ?= $(ROOT_DIR)/scripts/LICENSE_TEMPLATE
LICENSE_TEMPLATE ?= $(ROOT_DIR)/script/LICENSE_TEMPLATE
# TODO: GOBIN -> TOOLS_DIR
# Questions about go mod instead of go path: https://github.com/kubernetes/kubernetes/issues/117181
@@ -55,5 +55,5 @@ copyright.add: tools.verify.addlicense
## copyright.help: Show copyright help
.PHONY: copyright.help
copyright.help: scripts/make-rules/copyright.mk
copyright.help: script/make-rules/copyright.mk
$(call smallhelp)
+36
View File
@@ -0,0 +1,36 @@
# Copyright © 2023 OpenIMSDK.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# Makefile helper functions for dependencies
#
.PHONY: dependencies.run
dependencies.run: dependencies.packages dependencies.tools
.PHONY: dependencies.packages
dependencies.packages:
@$(GO) mod tidy
.PHONY: dependencies.tools
dependencies.tools: dependencies.tools.blocker dependencies.tools.critical
.PHONY: dependencies.tools.blocker
dependencies.tools.blocker: go.build.verify $(addprefix tools.verify., $(BLOCKER_TOOLS))
.PHONY: dependencies.tools.critical
dependencies.tools.critical: $(addprefix tools.verify., $(CRITICAL_TOOLS))
.PHONY: dependencies.tools.trivial
dependencies.tools.trivial: $(addprefix tools.verify., $(TRIVIAL_TOOLS))
+7 -1
View File
@@ -16,4 +16,10 @@
# Makefile helper functions for generate necessary files and docs
# https://cloud.redhat.com/blog/kubernetes-deep-dive-code-generation-customresources
# ! The stock of code generated by `make gen` should be idempotent
#
#
## gen.help: show help for gen
.PHONY: gen.help
gen.help: script/make-rules/gen.mk
$(call smallhelp)
+7 -1
View File
@@ -14,4 +14,10 @@
# ==============================================================================
# Build management helpers. These functions help to set, save and load the
#
#
## copyright.help: Show copyright help
.PHONY: go.help
go.help: script/make-rules/golang.mk
$(call smallhelp)
+8 -2
View File
@@ -16,6 +16,12 @@
# Makefile helper functions for docker image
# TODO: For the time being only used for compilation, it can be arm or amd, please do not delete it, it can be extended with new functions
# ==============================================================================
# Path: scripts/make-rules/image.mk
# Path: script/make-rules/image.mk
# docker registry: registry.example.com/namespace/image:tag as: registry.hub.docker.com/cubxxw/<image-name>:<tag>
#
#
## image.help: Print help for image targets
.PHONY: image.help
image.help: script/make-rules/image.mk
$(call smallhelp)
+4 -4
View File
@@ -132,9 +132,9 @@ install.github-release:
## install.gvm: Install gvm, gvm is a Go version manager, built on top of the official go tool.
.PHONY: install.gvm
install.gvm:
@echo "===========> Installing gvm,The default installation path is ~/.gvm/scripts/gvm"
@echo "===========> Installing gvm,The default installation path is ~/.gvm/script/gvm"
@bash < <(curl -s -S -L https://raw.gitee.com/moovweb/gvm/master/binscripts/gvm-installer)
@$(shell source /root/.gvm/scripts/gvm)
@$(shell source /root/.gvm/script/gvm)
## install.golines: Install golines, used to format long lines
.PHONY: install.golines
@@ -164,7 +164,7 @@ install.protoc-gen-go:
## install.cfssl: Install cfssl, used to generate certificates
.PHONY: install.cfssl
install.cfssl:
@$(ROOT_DIR)/scripts/install/install.sh iam::install::install_cfssl
@$(ROOT_DIR)/script/install/install.sh iam::install::install_cfssl
## install.depth: Install depth, used to check dependency tree
.PHONY: install.depth
@@ -198,5 +198,5 @@ install.codegen:
## tools.help: Display help information about the tools package
.PHONY: tools.help
tools.help: scripts/make-rules/tools.mk
tools.help: script/make-rules/tools.mk
$(call smallhelp)