forked from kubernetes-retired/kube-batch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (40 loc) · 1.36 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
BIN_DIR=_output/bin
RELEASE_VER=v0.5
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-goimports.sh
hack/verify-golint.sh
hack/verify-gencode.sh
init:
mkdir -p ${BIN_DIR}
generate-code:
go build -o ${BIN_DIR}/deepcopy-gen ./cmd/deepcopy-gen/
${BIN_DIR}/deepcopy-gen -i ./pkg/apis/scheduling/v1alpha1/ -O zz_generated.deepcopy
${BIN_DIR}/deepcopy-gen -i ./pkg/apis/scheduling/v1alpha2/ -O zz_generated.deepcopy
rel_bins:
go get github.com/mitchellh/gox
CGO_ENABLED=0 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-kind.sh
coverage:
KUBE_COVER=y hack/make-rules/test.sh $(WHAT) $(TESTS)
clean:
rm -rf _output/
rm -f kube-batch