forked from volcano-sh/volcano
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (57 loc) · 2.06 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
BIN_DIR=_output/bin
RELEASE_DIR=_output/release
REL_OSARCH=linux/amd64
REPO_PATH=volcano.sh/volcano
IMAGE_PREFIX=volcanosh/vc
TAG=latest
RELEASE_VER=v0.1
GitSHA=`git rev-parse HEAD`
Date=`date "+%Y-%m-%d %H:%M:%S"`
LD_FLAGS=" \
-X '${REPO_PATH}/pkg/version.GitSHA=${GitSHA}' \
-X '${REPO_PATH}/pkg/version.Built=${Date}' \
-X '${REPO_PATH}/pkg/version.Version=${RELEASE_VER}'"
.EXPORT_ALL_VARIABLES:
all: vc-scheduler vc-controllers vc-admission vcctl
init:
mkdir -p ${BIN_DIR}
mkdir -p ${RELEASE_DIR}
vc-scheduler: init
go build -ldflags ${LD_FLAGS} -o=${BIN_DIR}/vc-scheduler ./cmd/scheduler
vc-controllers: init
go build -ldflags ${LD_FLAGS} -o=${BIN_DIR}/vc-controllers ./cmd/controllers
vc-admission: init
go build -ldflags ${LD_FLAGS} -o=${BIN_DIR}/vc-admission ./cmd/admission
vcctl: init
go build -ldflags ${LD_FLAGS} -o=${BIN_DIR}/vcctl ./cmd/cli
image_bins: init
go get github.com/mitchellh/gox
CGO_ENABLED=0 gox -osarch=${REL_OSARCH} -ldflags ${LD_FLAGS} -output ${BIN_DIR}/${REL_OSARCH}/vcctl ./cmd/cli
for name in controllers scheduler admission; do\
CGO_ENABLED=0 gox -osarch=${REL_OSARCH} -ldflags ${LD_FLAGS} -output ${BIN_DIR}/${REL_OSARCH}/vc-$$name ./cmd/$$name; \
done
images: image_bins
for name in controllers scheduler admission; do\
cp ${BIN_DIR}/${REL_OSARCH}/vc-$$name ./installer/dockerfile/$$name/; \
docker build --no-cache -t $(IMAGE_PREFIX)-$$name:$(TAG) ./installer/dockerfile/$$name; \
rm installer/dockerfile/$$name/vc-$$name; \
done
admission-base-image:
docker build --no-cache -t $(IMAGE_PREFIX)-admission-base:$(TAG) ./installer/dockerfile/admission/ -f ./installer/dockerfile/admission/Dockerfile.base;
generate-code:
./hack/update-gencode.sh
unit-test:
go list ./... | grep -v e2e | xargs go test -v -cover -covermode atomic -coverprofile coverage.txt
e2e-test-kind:
./hack/run-e2e-kind.sh
generate-yaml: init
./hack/generate-yaml.sh
release: images generate-yaml
./hack/publish.sh
clean:
rm -rf _output/
rm -f *.log
verify: generate-code
hack/verify-gofmt.sh
hack/verify-golint.sh
hack/verify-gencode.sh