-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (32 loc) · 1000 Bytes
/
Makefile
File metadata and controls
42 lines (32 loc) · 1000 Bytes
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
IMG ?= notebook-controller
VERSION ?= v1.0.1
GIT_SHORT_COMMIT=$(shell git rev-parse --short HEAD)
TAG ?= ${VERSION}-${GIT_SHORT_COMMIT}-aliyun
SHELL := /bin/bash
GOLANG_VERSION ?= 1.15
USE_IMAGE_CACHE ?= true
fmt:
go fmt ./...
vet:
go vet ./...
generate: controller-gen
$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths=./api/...
docker-build: test
cd .. && docker build . -t ${IMG}:${TAG} -f ./notebook-controller/Dockerfile
@echo "updating kustomize image patch file for manager resource"
sed -i'' -e 's@image: .*@image: '"${IMG}:${TAG}"'@' ./config/default/manager_image_patch.yaml
docker-push:
docker push ${IMG}:${TAG}
controller-gen:
ifeq (, $(shell which controller-gen))
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.0
CONTROLLER_GEN=$(GOBIN)/controller-gen
else
CONTROLLER_GEN=$(shell which controller-gen)
endif
build:
docker build -t $(IMG):$(TAG) .
@echo Built $(IMG):$(TAG)
push:
docker push $(IMG):$(TAG)
@echo Pushed $(IMG):$(TAG)