Fetch the repository succeeded.
This action will force synchronization from FabEdge/fabedge, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
OUTPUT_DIR := _output
BINARIES := agent connector operator cert cloud-agent
IMAGES := $(addsuffix -image, ${BINARIES})
VERSION := v0.4.0
BUILD_TIME := $(shell date -u '+%Y-%m-%d_%H:%M:%S%z')
GIT_COMMIT := $(shell git rev-parse --short HEAD)
META := github.com/fabedge/fabedge/pkg/common/about
FLAG_VERSION := ${META}.version=${VERSION}
FLAG_BUILD_TIME := ${META}.buildTime=${BUILD_TIME}
FLAG_GIT_COMMIT := ${META}.gitCommit=${GIT_COMMIT}
GOLDFLAGS ?= -s -w
LDFLAGS := -ldflags "${GOLDFLAGS} -X ${FLAG_VERSION} -X ${FLAG_BUILD_TIME} -X ${FLAG_GIT_COMMIT}"
CRD_OPTIONS ?= "crd:trivialVersions=true"
KUBEBUILDER_VERSION ?= 2.3.1
GOOS ?= $(shell uname -s | tr '[:upper:]' '[:lower:]')
GOARCH ?= amd64
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
export KUBEBUILDER_ASSETS ?= $(GOBIN)
all: clean bin
define HELP_INFO
# Build
#
# Args:
# GOLDFLAGS: Specify GOLDFLAGS to pass options to go build, when GOLDFLAGS is unspecified,
# it defaults to "-s -w" which strips debug information
# make all
# make agent
# make connector
# make operator
# make connector-image
# make strongswan-image
# make operator-image
# make agent-image
# make e2e-test
endef
help:
echo ${HELP_INFO}
fmt:
GOOS=linux go fmt ./...
vet:
GOOS=linux go vet ./...
bin: fmt vet ${BINARIES}
${BINARIES}: $(if $(QUICK),,fmt vet)
GOOS=linux go build ${LDFLAGS} -o ${OUTPUT_DIR}/fabedge-$@ ./cmd/$@
.PHONY: test
test:
ifneq (,$(shell which ginkgo))
ginkgo ./pkg/...
else
go test ./pkg/...
endif
e2e-test:
go test ${LDFLAGS} -c ./test/e2e -o ${OUTPUT_DIR}/fabedge-e2e.test
${IMAGES}: APP=$(subst -image,,$@)
${IMAGES}:
docker build -t fabedge/${APP}:latest -f build/${APP}/Dockerfile .
fabedge-images: ${IMAGES}
strongswan-image:
docker build -t fabedge/strongswan:latest -f build/strongswan/Dockerfile .
installer-image:
docker build -t fabedge/installer:latest -f build/installer/Dockerfile .
clean:
go clean -cache -testcache
rm -rf ${OUTPUT_DIR}
# Generate manifests e.g. CRD, RBAC etc.
manifests: controller-gen
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=fabedge-admin paths="./pkg/..." output:dir:crd=deploy/crds
@# 因为k8s的bug, 导致必须手动删除一些信息,详细内容参考 https://github.com/kubernetes/kubernetes/issues/91395
# sed -i '/- protocol/d' build/crds/edge.bocloud.com_edgeapplications.yaml
# Generate code
generate: controller-gen
$(CONTROLLER_GEN) object paths="./pkg/..."
# find or download controller-gen
# download controller-gen if necessary
controller-gen:
ifeq (, $(shell which controller-gen))
@{ \
set -e ;\
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$CONTROLLER_GEN_TMP_DIR ;\
go mod init tmp ;\
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.7.0 ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
}
CONTROLLER_GEN=$(GOBIN)/controller-gen
else
CONTROLLER_GEN=$(shell which controller-gen)
endif
install-test-dependencies:
curl -sL https://github.com/kubernetes-sigs/kubebuilder/releases/download/v$(KUBEBUILDER_VERSION)/kubebuilder_$(KUBEBUILDER_VERSION)_$(GOOS)_$(GOARCH).tar.gz | \
tar -zx -C ${GOBIN} --strip-components=2
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。