k8s: Add Makefile targets for testing
[integration.git] / test / security / k8s / Makefile
1 PROJECT = check
2 BIN_DIR = bin
3 SRC_DIR = src
4 PKG_DIR = pkg
5 BIN = check
6
7 all: run
8
9 run: build
10         $(BIN_DIR)/$(BIN)
11
12 build: $(BIN)
13
14 $(BIN): export GOPATH = $(shell pwd)
15 $(BIN): deps
16         go install $(PROJECT)/cmd/$(BIN)
17
18 deps: export GOPATH = $(shell pwd)
19 deps:
20         go get $(PROJECT)/...
21
22 clean_deps: export GOPATH = $(shell pwd)
23 clean_deps:
24         go clean -i -r $(PROJECT)/... 2>/dev/null || true
25
26 test: export GOPATH = $(shell pwd)
27 test: test_deps
28         go test $(PROJECT)/...
29
30 test_watch: export GOPATH = $(shell pwd)
31 test_watch: test_deps
32         $(BIN_DIR)/ginkgo watch $(SRC_DIR)/$(PROJECT)/...
33
34 test_deps: export GOPATH = $(shell pwd)
35 test_deps:
36         go get github.com/onsi/ginkgo/ginkgo
37         go get -t $(PROJECT)/...
38
39 clean_test_deps: export GOPATH = $(shell pwd)
40 clean_test_deps:
41         go clean -i -r github.com/onsi/ginkgo/ginkgo 2>/dev/null || true
42
43 clean: clean_deps clean_test_deps
44         -rmdir $(BIN_DIR)
45         rm -rf $(PKG_DIR)
46         find $(SRC_DIR) -mindepth 1 -maxdepth 1 ! -name $(PROJECT) -exec rm -rf {} +
47
48 .PHONY: all run build deps clean_deps test test_watch test_deps clean_test_deps clean $(BIN)