-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile
57 lines (46 loc) · 2.01 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
# this is the classic first makefile target, and it's also the default target
# run when `make` is invoked with no specific target.
all: build
# build uses a build container to build a minimalist image which is suitable
# for releases. you can specify a BUILD_VERSION here, e.g., BUILD_VERSION=foo
# will build 'auth_proxy:foo'. if you omit the BUILD_VERSION, it defaults to
# "devbuild".
build: checks
@bash ./scripts/build.sh
# checks runs a script which runs gofmt, go vet, and other code quality tools.
checks:
@bash ./scripts/checks.sh
# ci does everything necessary for a Github PR-triggered CI run.
# currently, this means building a container image and running
# all of the available tests.
ci: generate-certificate build test
# generate-certificate generates a local key and cert for running the proxy.
# if an existing certificate and key exist, it will do nothing.
# if either of them do not exist, they will both be recreated.
generate-certificate:
@bash ./scripts/generate_certificate.sh
# godep rebuilds Godeps/Godeps.json
# you will only need to run this if you add a new external dependency.
godep:
[ -n "`which godep`" ] || go get -u github.com/tools/godep
godep save ./...
# run target runs an auth proxy setup without a netmaster
# It's handy to test proxy only changes w/o requiring a full
# e2e setup. Run generate-certificate and build before this,
# or put certs in appropriate folder. See docker-compose.yaml
# for more details.
run:
docker-compose up -d
# shfmt formats all shell scripts in a standardized way
shfmt:
go get github.com/contiv-experimental/sh/cmd/shfmt || :
find . -type f -name "*.sh" -and -not -path "./vendor/*" -print0 | xargs -0 shfmt -w
# systemtests runs the system tests suite.
systemtests: generate-certificate
@bash ./scripts/systemtests.sh
# unittests runs all the unit tests
unit-tests: generate-certificate
@bash ./scripts/unittests.sh
# test runs ALL the test suites.
test: systemtests unit-tests
.PHONY: all build checks ci generate-certificate godep run systemtests unit-tests test