-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
89 lines (70 loc) · 2.98 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
79
80
81
82
83
84
85
86
87
88
89
.PHONY: all test
gopath := $(shell go env GOPATH)
gitCommit := $(shell git rev-parse --short HEAD)
# go version output is "go version go1.11.2 linux/amd64"
goVersion := $(word 3,$(shell go version))
goLDFlags := -ldflags "-X main.gitCommit=${gitCommit} -X main.productVersion=0.1 -X main.goVersion=${goVersion}"
pmsImageRepo := speedle-pms
pmsImageTag := v0.1
adsImageRepo := speedle-ads
adsImageTag := v0.1
all: build
build: buildPms buildAds buildSpctl
buildPms:
go build ${goLDFlags} -o ${gopath}/bin/speedle-pms github.com/teramoby/speedle-plus/cmd/speedle-pms
buildAds:
go build ${goLDFlags} -o ${gopath}/bin/speedle-ads github.com/teramoby/speedle-plus/cmd/speedle-ads
buildSpctl:
go build ${goLDFlags} -o ${gopath}/bin/spctl github.com/teramoby/speedle-plus/cmd/spctl
image: imagePms imageAds
imagePms:
cp ${gopath}/bin/speedle-pms deployment/docker/speedle-pms/.
docker build -t ${pmsImageRepo}:${pmsImageTag} --rm --no-cache deployment/docker/speedle-pms
rm deployment/docker/speedle-pms/speedle-pms
imageAds:
cp ${gopath}/bin/speedle-ads deployment/docker/speedle-ads/.
docker build -t ${adsImageRepo}:${adsImageTag} --rm --no-cache deployment/docker/speedle-ads
rm deployment/docker/speedle-ads/speedle-ads
test: testAll
testAll: speedleUnitTests testSpeedleRest testSpeedleGRpc testSpctl testSpeedleRestADSCheck testSpeedleGRpcADSCheck testSpeedleTls
speedleUnitTests:
go test ${TEST_OPTS} github.com/teramoby/speedle-plus/pkg/cfg
go test ${TEST_OPTS} github.com/teramoby/speedle-plus/pkg/eval
go test ${TEST_OPTS} github.com/teramoby/speedle-plus/pkg/store/file
go test ${TEST_OPTS} github.com/teramoby/speedle-plus/pkg/store/etcd
go test ${TEST_OPTS} github.com/teramoby/speedle-plus/pkg/store/mongodb
go test ${TEST_OPTS} github.com/teramoby/speedle-plus/pkg/pdl
go test ${TEST_OPTS} github.com/teramoby/speedle-plus/pkg/suid
go test ${TEST_OPTS} github.com/teramoby/speedle-plus/pkg/assertion
go clean -testcache
STORE_TYPE=etcd go test ${TEST_OPTS} github.com/teramoby/speedle-plus/pkg/eval
go clean -testcache
STORE_TYPE=mongodb go test ${TEST_OPTS} github.com/teramoby/speedle-plus/pkg/eval
testSpeedleRest:
pkg/svcs/pmsrest/run_file_test.sh
pkg/svcs/pmsrest/run_etcd_test.sh
pkg/svcs/pmsrest/run_mongodb_test.sh
testSpeedleGRpc:
pkg/svcs/pmsgrpc/run_file_test.sh
pkg/svcs/pmsgrpc/run_etcd_test.sh
pkg/svcs/pmsgrpc/run_mongodb_test.sh
testSpeedleRestADSCheck:
pkg/svcs/adsrest/run_file_test.sh
pkg/svcs/adsrest/run_etcd_test.sh
pkg/svcs/adsrest/run_mongodb_test.sh
testSpeedleGRpcADSCheck:
pkg/svcs/adsgrpc/run_file_test.sh
pkg/svcs/adsgrpc/run_etcd_test.sh
pkg/svcs/adsgrpc/run_mongodb_test.sh
testSpctl:
cmd/spctl/command/run_file_test.sh
cmd/spctl/command/run_etcd_test.sh
cmd/spctl/command/run_mongodb_test.sh
testSpeedleTls:
pkg/svcs/pmsrest/tls_test.sh
pkg/svcs/pmsrest/tls_test-force-client-cert.sh
clean:
rm -rf ${gopath}/pkg/linux_amd64/github.com/teramoby/speedle-plus
rm -f ${gopath}/bin/speedle-pms
rm -f ${gopath}/bin/speedle-ads
rm -f ${gopath}/bin/spctl