aboutsummaryrefslogtreecommitdiffstats
path: root/test/security/k8s
diff options
context:
space:
mode:
Diffstat (limited to 'test/security/k8s')
-rw-r--r--test/security/k8s/.gitignore5
-rw-r--r--test/security/k8s/Makefile19
2 files changed, 20 insertions, 4 deletions
diff --git a/test/security/k8s/.gitignore b/test/security/k8s/.gitignore
index 3db554d59..6f63a3aa1 100644
--- a/test/security/k8s/.gitignore
+++ b/test/security/k8s/.gitignore
@@ -1,2 +1,7 @@
# Built binaries
/bin/check
+
+# Go packages, sources (except this project)
+/pkg/
+/src/*
+!/src/check/
diff --git a/test/security/k8s/Makefile b/test/security/k8s/Makefile
index b42e48acc..e7f978fc2 100644
--- a/test/security/k8s/Makefile
+++ b/test/security/k8s/Makefile
@@ -1,5 +1,7 @@
PROJECT = check
BIN_DIR = bin
+SRC_DIR = src
+PKG_DIR = pkg
BIN = check
all: run
@@ -10,15 +12,24 @@ run: build
build: $(BIN)
$(BIN): export GOPATH = $(shell pwd)
-$(BIN):
+$(BIN): deps
go install $(PROJECT)/cmd/$(BIN)
+deps: export GOPATH = $(shell pwd)
+deps:
+ go get $(PROJECT)/...
+
+clean_deps: export GOPATH = $(shell pwd)
+clean_deps:
+ go clean -i -r $(PROJECT)/... 2>/dev/null || true
+
test: export GOPATH = $(shell pwd)
test:
go test $(PROJECT)/...
-clean:
- -rm $(BIN_DIR)/$(BIN)
+clean: clean_deps
-rmdir $(BIN_DIR)
+ rm -rf $(PKG_DIR)
+ find $(SRC_DIR) -mindepth 1 -maxdepth 1 ! -name $(PROJECT) -exec rm -rf {} +
-.PHONY: all run build test clean $(BIN)
+.PHONY: all run build deps clean_deps test clean $(BIN)