forked from kubernetes-retired/kube-batch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (38 loc) · 1.24 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
BIN_DIR=_output/bin
RELEASE_VER=v0.4
REPO_PATH=github.com/kubernetes-sigs/kube-batch
GitSHA=`git rev-parse HEAD`
Date=`date "+%Y-%m-%d %H:%M:%S"`
REL_OSARCH="linux/amd64"
LD_FLAGS=" \
-X '${REPO_PATH}/pkg/version.GitSHA=${GitSHA}' \
-X '${REPO_PATH}/pkg/version.Built=${Date}' \
-X '${REPO_PATH}/pkg/version.Version=${RELEASE_VER}'"
kube-batch: init
go build -ldflags ${LD_FLAGS} -o=${BIN_DIR}/kube-batch ./cmd/kube-batch
verify: generate-code
hack/verify-gofmt.sh
hack/verify-golint.sh
hack/verify-gencode.sh
init:
mkdir -p ${BIN_DIR}
generate-code: init
go build -o ${BIN_DIR}/deepcopy-gen ./cmd/deepcopy-gen/
${BIN_DIR}/deepcopy-gen -i ./pkg/apis/scheduling/v1alpha1/ -O zz_generated.deepcopy
rel_bins:
go get github.com/mitchellh/gox
gox -osarch=${REL_OSARCH} -ldflags ${LD_FLAGS} \
-output=${BIN_DIR}/{{.OS}}/{{.Arch}}/kube-batch ./cmd/kube-batch
images: rel_bins
cp ./_output/bin/${REL_OSARCH}/kube-batch ./deployment/images/
docker build ./deployment/images -t kubesigs/kube-batch:${RELEASE_VER}
rm -f ./deployment/images/kube-batch
run-test:
hack/make-rules/test.sh $(WHAT) $(TESTS)
e2e: kube-batch
hack/run-e2e.sh
coverage:
KUBE_COVER=y hack/make-rules/test.sh $(WHAT) $(TESTS)
clean:
rm -rf _output/
rm -f kube-batch