代码拉取完成,页面将自动刷新
PREFIX ?= registry.cn-hangzhou.aliyuncs.com/rdc-incubator
TAG ?= $(shell date +%s)
SHADOW_IMAGE = kt-connect-shadow
SHADOW_BASE_IMAGE = shadow-base
BUILDER_IMAGE = builder
DASHBOARD_IMAGE = kt-connect-dashboard
SERVER_IMAGE = kt-connect-server
# generate mock
generate-mock:
mkdir -p fake/kt/action
mockgen -source=pkg/kt/command/types.go -destination=fake/kt/action/action_mock.go -package=action
mkdir -p fake/kt/cluster
mockgen -source=pkg/kt/cluster/types.go -destination=fake/kt/cluster/kubernetes_mock.go -package=cluster
mkdir -p fake/kt/connect
mockgen -source=pkg/kt/connect/types.go -destination=fake/kt/connect/connect_mock.go -package=connect
mkdir -p fake/kt/exec
mockgen -source=pkg/kt/exec/kubectl/types.go -destination=fake/kt/exec/kubectl/kubectl_mock.go -package=kubectl
mockgen -source=pkg/kt/exec/ssh/types.go -destination=fake/kt/exec/ssh/ssh_mock.go -package=ssh
mockgen -source=pkg/kt/exec/sshuttle/types.go -destination=fake/kt/exec/sshuttle/sshuttle_mock.go -package=sshuttle
mockgen -source=pkg/kt/exec/types.go -destination=fake/kt/exec/exec_mock.go -package=exec
mockgen -source=pkg/kt/types.go -destination=fake/kt/kt_mock.go -package=kt
# run unit test
test:
mkdir -p artifacts/report/coverage
go test -v -cover -coverprofile c.out.tmp ./...
cat c.out.tmp | grep -v "_mock.go" > c.out
go tool cover -html=c.out -o artifacts/report/coverage/index.html
# build kt project
build: build-connect build-shadow build-server build-dashboard
# check the style
check:
golint ./pkg/... ./cmd/...
# golangci-lint run ./pkg/...
# build ktctl
build-connect:
scripts/build-ktctl
scripts/archive
# build connect plugin
build-connect-plugin:
scripts/build-kubectl-plugin-connect
scripts/archive-plugins
# build this image before shadow
build-shadow-base:
docker build -t $(PREFIX)/$(SHADOW_BASE_IMAGE):$(TAG) -f build/docker/shadow/Dockerfile_base .
# build shadow
build-shadow:
GOARCH=amd64 GOOS=linux go build -gcflags "all=-N -l" -o artifacts/shadow/shadow-linux-amd64 cmd/shadow/main.go
docker build -t $(PREFIX)/$(SHADOW_IMAGE):$(TAG) -f build/docker/shadow/Dockerfile .
# release shadow
release-shadow:
docker push $(PREFIX)/$(SHADOW_IMAGE):$(TAG)
# dlv for debug
build-shadow-dlv:
scripts/build-shadow-dlv
build-dashboard: build-frontend build-server
build-frontend:
docker build -t $(PREFIX)/$(DASHBOARD_IMAGE):$(TAG) -f build/docker/dashboard/Dockerfile .
build-server:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o artifacts/apiserver/apiserver-linux-amd64 cmd/server/main.go
docker build -t $(PREFIX)/$(SERVER_IMAGE):$(TAG) -f build/docker/apiserver/Dockerfile .
release-dashboard:
docker push $(PREFIX)/$(DASHBOARD_IMAGE):$(TAG)
docker push $(PREFIX)/$(SERVER_IMAGE):$(TAG)
git-release:
scripts/release
dryrun-release:
goreleaser --snapshot --skip-publish --rm-dist
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。