forked from google/containerdbg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (56 loc) · 2 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
.PHONY: ALL
all: images build-go-linux
TARGET_REPO ?= ko.local
export TARGET_REPO
IMAGE_PULL_POLICY ?= IfNotPresent
TAG ?= latest
ifeq ($(TARGET_REPO),ko.local)
IMAGE_PULL_POLICY = Never
endif
include Makefile.btf.mk
include Makefile.proto.mk
include Makefile.deploy.mk
include Makefile.go.mk
include Makefile.image.mk
export TEST_FLAGS
test-image:
docker build . -t containerdbg-test -f test/image/Dockerfile
test-in-container:
export TEMPDIR=$(shell mktemp -d) && \
echo "$$TEMPDIR" && \
cp -r $(PWD)/. $${TEMPDIR} && \
docker run --privileged -e DOCKER_IN_DOCKER_ENABLED=true \
-v ${HOME}/go/pkg:/go/pkg \
-v /tmp/docker-graph:/docker-graph -v $${TEMPDIR}:/build -w /build \
-v /sys/kernel/debug/:/sys/kernel/debug/ \
-v /sys/fs/bpf/:/sys/fs/bpf/ \
-v ${PWD}/artifacts:/artifacts \
-v ${HOME}/.config/gcloud/application_default_credentials.json:/tmp/keys/creds.json \
-e TEST_FLAGS=$(TEST_FLAGS) \
-e COVERPROFILE=/artifacts/cover.prof \
-e GOOGLE_APPLICATION_CREDENTIALS=/tmp/keys/creds.json \
eu.gcr.io/modernize-prow/containerdbg-test:latest \
./test/image/runner.sh make test
.PHONY: images
images: node-daemon containerdbg-entrypoint dnsproxy
.PHONY: test-tomcat
test-tomcat:
cd examples/petclinic/tomcat/; docker build . -t tomcat-petclinic
#docker pull eu.gcr.io/modernize-prow/tomcat-petclinic
.PHONY: test-images
test-images: test-binary test-openfile test-tomcat
.PHONY: prepare-kind-cluster
prepare-kind-cluster: images test-images
-kind load docker-image ko.local/entrypoint:latest
-kind load docker-image ko.local/dnsproxy:latest
-kind load docker-image ko.local/node-daemon:latest
-kind load docker-image ko.local/test-binary:latest
-kind load docker-image ko.local/test-openfile:latest
.PHONY: example
example: prepare-kind-cluster
kubectl apply -f ./deploy/node-daemon.yaml
kubectl apply -f ./examples/modified_pod.yaml
.PHONY: test
test: generate build-go-linux images test-images
go test -coverprofile $(COVERPROFILE) -coverpkg ./... ./... $(TEST_FLAGS)
pre: deployment