-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
55 lines (39 loc) · 1.56 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
TARGET_PLATFORMS ?= linux/amd64
IMAGE_REPO ?= openyurt
IMAGE_TAG ?= v0.1.0
GIT_VERSION ?=$(IMAGE_TAG)
DOCKER_USERNAME ?= ""
DOCKER_PASSWD ?= ""
GIT_VERSION ?=$(IMAGE_TAG)
DOCKER_BUILD_ARGS = --build-arg GIT_VERSION=${GIT_VERSION}
ifeq (${REGION}, cn)
DOCKER_BUILD_ARGS += --build-arg GOPROXY=https://goproxy.cn --build-arg MIRROR_REPO=mirrors.aliyun.com
endif
.PHONY: clean all build
all: build
# Build binaries in the host environment
build: fmt vet
GIT_VERSION=${GIT_VERSION} hack/make-rules/build.sh $(WHAT)
# Run go fmt against code
fmt:
go fmt ./pkg/... ./cmd/...
# Run go vet against code
vet:
go vet ./pkg/... ./cmd/...
clean:
-rm -Rf _output
gen-yaml:
hack/make-rules/manifest.sh ${IMAGE_REPO}/edge-proxy:${GIT_VERSION} ${DOCKER_USERNAME} ${DOCKER_PASSWD}
aliyun-config:
rm ~/.kube/config
ln -s ~/.kube/aliyun_config ~/.kube/config
local-config:
rm ~/.kube/config
ln -s ~/.kube/minikube_config ~/.kube/config
docker-build-deploy:
hack/make-rules/manifest.sh ${IMAGE_REPO}/edge-proxy:${GIT_VERSION} ${DOCKER_USERNAME} ${DOCKER_PASSWD}
docker buildx build --push ${DOCKER_BUILD_ARGS} --platform ${TARGET_PLATFORMS} -f hack/dockerfiles/Dockerfile . -t ${IMAGE_REPO}/edge-proxy:${GIT_VERSION}
docker-build:
docker buildx build --push ${DOCKER_BUILD_ARGS} --platform ${TARGET_PLATFORMS} -f hack/dockerfiles/Dockerfile . -t ${IMAGE_REPO}/edge-proxy:${GIT_VERSION}
docker-build-go: # custom go version
docker buildx build --push ${DOCKER_BUILD_ARGS} --platform ${TARGET_PLATFORMS} -f hack/dockerfiles/amd64.Dockerfile . -t ${IMAGE_REPO}/edge-proxy:${GIT_VERSION}