-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
78 lines (59 loc) · 2.13 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
72
73
74
75
76
77
78
.PHONY: test vendor
version=latest
all:
@echo "did you mean 'make test' ?"
vendor:
./hack/vendor.sh
guard-%:
@ if [ "${${*}}" = "" ]; then \
echo "Env var '$*' not set"; \
exit 1; \
fi
publish:image
docker push neowaylabs/klb:$(version)
image:
export TERMINFO=""
docker build . -t neowaylabs/klb:$(version)
credentials: image guard-sh guard-subscription guard-service-principal guard-service-secret
docker run -ti --rm -v `pwd`:/credentials -w /credentials neowaylabs/klb:$(version) \
/credentials/tools/azure/getcredentials.sh \
$(sh) "$(subscription)" "$(service-principal)" "$(service-secret)"
createsp: image guard-subscription-id guard-service-principal guard-service-secret
docker run -ti --rm -v `pwd`:/createsp -w /createsp neowaylabs/klb:$(version) \
/createsp/tools/azure/createsp.sh \
"$(subscription-id)" "$(service-principal)" "$(service-secret)"
shell: image
./hack/run-tty.sh nash
example-%: image
./hack/run-tty.sh ./examples/azure/$*/build.sh
example-%-cleanup: image
./hack/run-tty.sh ./examples/azure/$*/cleanup.sh
libdir=$(NASHPATH)/lib/klb
bindir=$(NASHPATH)/bin
install: guard-NASHPATH
@rm -rf $(libdir)
@mkdir -p $(libdir)
@mkdir -p $(bindir)
@cp -pr ./aws $(libdir)
@cp -pr ./azure $(libdir)
@cp -pr ./tools/azure/getcredentials.sh $(bindir)/azure-credentials.sh
@cp -pr ./tools/azure/createsp.sh $(bindir)/createsp.sh
timeout?=90m
logger?=file
parallel?=10 # Explore I/O parallelization
cpu?=5 # Force threads to be created
gotest=go test -v ./tests/azure -parallel $(parallel) -cpu $(cpu)
gotestargs=-args -logger $(logger)
test: image
./hack/run.sh nash ./azure/vm_test.sh
test-integration: image
./hack/run.sh $(gotest) -timeout $(timeout) -run=$(run) $(gotestargs)
test-examples: image
./hack/run.sh $(gotest) -timeout $(timeout) -tags=examples -run=TestExamples $(gotestargs)
# It is recommended to use this locally. It takes too much time for the CI
test-all: image
./hack/run.sh $(gotest) -timeout $(timeout) -tags=examples $(gotestargs)
cleanup: image
./hack/run-tty.sh ./tools/azure/cleanup.sh
testhost:
$(gotest) -run=$(run) ./... $(gotestargs)