-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
42 lines (30 loc) · 968 Bytes
/
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
# Variables
GOCMD = go
GOBUILD_ENVS = CGO_ENABLED=0 GOOS=linux GOARCH=amd64
GOBUILD = $(GOCMD) build
GOCLEAN = $(GOCMD) clean
GOTEST = $(GOCMD) test
GOTEST_SUDO_PREFIX = sudo --preserve-env=HOME --preserve-env=GOPATH
GOGET = $(GOCMD) get
BINARY_NAME = kapprofiler
GOFILES = $(shell find . -type f -name '*.go')
# Take image name from env variable or use default
IMAGE_NAME ?= kapprofiler:latest
$(BINARY_NAME): $(GOFILES) go.mod go.sum Makefile
CGO_ENABLED=1 go build -o $(BINARY_NAME) -v
test:
$(GOTEST_SUDO_PREFIX) $(GOTEST) -v ./...
install: $(BINARY_NAME)
./scripts/install-in-pod.sh $(BINARY_NAME)
open-shell:
./scripts/open-shell-in-pod.sh
deploy-dev-pod:
kubectl apply -f etc/app-profile.crd.yaml
kubectl apply -f dev/devpod.yaml
build: $(BINARY_NAME)
build-image: $(GOFILES) go.mod go.sum Makefile
docker build -t $(IMAGE_NAME) .
clean:
rm -f $(BINARY_NAME)
all: $(BINARY_NAME)
.PHONY: clean all install deploy-dev-pod test open-shell build