forked from aws/aws-node-termination-handler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
89 lines (63 loc) · 2.57 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
VERSION = $(shell git describe --tags --always --dirty)
IMG ?= amazon/aws-node-termination-handler
IMG_TAG ?= ${VERSION}
IMG_W_TAG = ${IMG}:${IMG_TAG}
DOCKER_USERNAME ?= ""
DOCKER_PASSWORD ?= ""
GOOS ?= linux
GOARCH ?= amd64
GOPROXY ?= "https://proxy.golang.org,direct"
MAKEFILE_PATH = $(dir $(realpath -s $(firstword $(MAKEFILE_LIST))))
BUILD_DIR_PATH = ${MAKEFILE_PATH}/build
SUPPORTED_PLATFORMS ?= "linux/amd64,linux/arm64,linux/arm"
compile:
@echo ${MAKEFILE_PATH}
go build -a -tags nth${GOOS} -o ${BUILD_DIR_PATH}/node-termination-handler ${MAKEFILE_PATH}/cmd/node-termination-handler.go
create-build-dir:
mkdir -p ${BUILD_DIR_PATH}
clean:
rm -rf ${BUILD_DIR_PATH}/
fmt:
goimports -w ./
docker-build:
${MAKEFILE_PATH}/scripts/build-docker-images -d -p ${GOOS}/${GOARCH} -r ${IMG} -v ${VERSION}
docker-run:
docker run ${IMG_W_TAG}
docker-push:
@echo ${DOCKER_PASSWORD} | docker login -u ${DOCKER_USERNAME} --password-stdin
docker push ${IMG_W_TAG}
build-docker-images:
${MAKEFILE_PATH}/scripts/build-docker-images -d -p ${SUPPORTED_PLATFORMS} -r ${IMG} -v ${VERSION}
push-docker-images:
@echo ${DOCKER_PASSWORD} | docker login -u ${DOCKER_USERNAME} --password-stdin
${MAKEFILE_PATH}/scripts/push-docker-images -p ${SUPPORTED_PLATFORMS} -r ${IMG} -v ${VERSION} -m
version:
@echo ${VERSION}
image:
@echo ${IMG_W_TAG}
e2e-test:
${MAKEFILE_PATH}/test/k8s-local-cluster-test/run-test -b e2e-test -d
compatibility-test:
${MAKEFILE_PATH}/test/k8s-compatibility-test/run-k8s-compatibility-test.sh -p "-d"
license-test:
${MAKEFILE_PATH}/test/license-test/run-license-test.sh
go-report-card-test:
${MAKEFILE_PATH}/test/go-report-card-test/run-report-card-test.sh
helm-sync-test:
${MAKEFILE_PATH}/test/helm-sync-test/run-helm-sync-test
helm-version-sync-test:
${MAKEFILE_PATH}/test/helm-sync-test/run-helm-version-sync-test
build-binaries:
${MAKEFILE_PATH}/scripts/build-binaries -d -p ${SUPPORTED_PLATFORMS} -v ${VERSION}
upload-resources-to-github:
${MAKEFILE_PATH}/scripts/upload-resources-to-github
generate-k8s-yaml:
${MAKEFILE_PATH}/scripts/generate-k8s-yaml
sync-readme-to-dockerhub:
${MAKEFILE_PATH}/scripts/sync-readme-to-dockerhub
unit-test: create-build-dir
go test -bench=. ${MAKEFILE_PATH}/... -v -coverprofile=coverage.txt -covermode=atomic -outputdir=${BUILD_DIR_PATH}
build: create-build-dir compile
helm-tests: helm-sync-test helm-version-sync-test
release: create-build-dir build-binaries build-docker-images push-docker-images generate-k8s-yaml upload-resources-to-github
test: unit-test e2e-test compatibility-test license-test go-report-card-test helm-sync-test