-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
167 lines (127 loc) · 5 KB
/
Makefile
File metadata and controls
167 lines (127 loc) · 5 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#
# CHECK
#
check-docker-deps:
@which docker > /dev/null
@which docker-compose > /dev/null
check-go-deps:
@which protoc > /dev/null
@which protoc-gen-go > /dev/null
@which gometalinter > /dev/null
check-arduino-deps:
@which arduino > /dev/null
check: check-docker-deps check-go-deps check-arduino-deps
#
# BUILD
#
build-android:
@(cd android && ./gradlew assembleDebug)
#
# DOCKER
#
docker:
@(cd services/microservice && docker build -t smarthomeadapters/microservice .)
@docker-compose build
docker-push:
@docker tag smarthomeadapters/clientserver smarthomeadapters/clientserver:latest
@docker push smarthomeadapters/clientserver:latest
@docker tag smarthomeadapters/infodb smarthomeadapters/infodb:latest
@docker push smarthomeadapters/infodb:latest
@docker tag smarthomeadapters/infoserver smarthomeadapters/infoserver:latest
@docker push smarthomeadapters/infoserver:latest
@docker tag smarthomeadapters/robotserver smarthomeadapters/robotserver:latest
@docker push smarthomeadapters/robotserver:latest
@docker tag smarthomeadapters/usecasedb smarthomeadapters/usecasedb:latest
@docker push smarthomeadapters/usecasedb:latest
@docker tag smarthomeadapters/usecaseserver smarthomeadapters/usecaseserver:latest
@docker push smarthomeadapters/usecaseserver:latest
@docker tag smarthomeadapters/userdb smarthomeadapters/userdb:latest
@docker push smarthomeadapters/userdb:latest
@docker tag smarthomeadapters/userserver smarthomeadapters/userserver:latest
@docker push smarthomeadapters/userserver:latest
@docker tag smarthomeadapters/account-app smarthomeadapters/account-app:latest
@docker push smarthomeadapters/account-app:latest
docker-push-test:
@docker tag smarthomeadapters/clientserver smarthomeadapters/clientserver:test
@docker push smarthomeadapters/clientserver:test
@docker tag smarthomeadapters/infodb smarthomeadapters/infodb:test
@docker push smarthomeadapters/infodb:test
@docker tag smarthomeadapters/infoserver smarthomeadapters/infoserver:test
@docker push smarthomeadapters/infoserver:test
@docker tag smarthomeadapters/robotserver smarthomeadapters/robotserver:test
@docker push smarthomeadapters/robotserver:test
@docker tag smarthomeadapters/usecasedb smarthomeadapters/usecasedb:test
@docker push smarthomeadapters/usecasedb:test
@docker tag smarthomeadapters/usecaseserver smarthomeadapters/usecaseserver:test
@docker push smarthomeadapters/usecaseserver:test
@docker tag smarthomeadapters/userdb smarthomeadapters/userdb:test
@docker push smarthomeadapters/userdb:test
@docker tag smarthomeadapters/userserver smarthomeadapters/userserver:test
@docker push smarthomeadapters/userserver:test
@docker tag smarthomeadapters/account-app smarthomeadapters/account-app:test
@docker push smarthomeadapters/account-app:test
#
# LINT
#
GOLINT = golangci-lint run ./... -E=golint -E=stylecheck -E=gosec -E=unconvert -E=goconst -E=gofmt -E=goimports -E=maligned -E=lll -E=unparam -E=nakedret
lint-account-app:
@(cd services/account-app && $(GOLINT))
lint-clientserver:
@(cd services/clientserver && $(GOLINT))
lint-infoserver:
@(cd services/infoserver && $(GOLINT))
lint-microservice:
@(cd services/microservice && $(GOLINT))
lint-robotserver:
@(cd services/robotserver && $(GOLINT))
lint-userserver:
@(cd services/userserver && $(GOLINT))
lint-services: lint-account-app lint-clientserver lint-infoserver lint-microservice lint-robotserver lint-userserver
lint-android:
@(cd android && ./gradlew lint)
lint-docker-compose:
docker-compose config
lint: lint-services lint-android lint-docker-compose
#
# DB
#
db-up:
@docker run --rm -d --name test_infodb -p 5001:5432 -e POSTGRES_USER=temp -e POSTGRES_PASSWORD=password smarthomeadapters/infodb
@docker run --rm -d --name test_userdb -p 5004:5432 -e POSTGRES_USER=temp -e POSTGRES_PASSWORD=password smarthomeadapters/userdb
db-down:
@docker stop test_infodb
@docker stop test_userdb
#
# TEST
#
test-android:
@(cd android && ./gradlew test)
test-account-app:
@(cd services/account-app && go test)
test-clientserver:
@(cd services/clientserver && go test)
test-infoserver:
@(cd services/infoserver && DB_URL=localhost:5001 DB_USERNAME=temp DB_PASSWORD=password DB_DATABASE=temp go test)
test-microservice:
@(cd services/microservice && go test)
test-robotserver:
@(cd services/robotserver && go test)
test-userserver:
@(cd services/userserver && DB_URL=localhost:5004 DB_USERNAME=temp DB_PASSWORD=password DB_DATABASE=temp go test)
test-services: test-account-app test-clientserver test-infoserver test-microservice test-robotserver test-userserver
test: test-services test-android
#
# Reports
#
compile-reports:
for DIR in reports/*/; \
do \
echo "Compiling $${DIR}"; \
docker run --mount src=$$PWD/$${DIR},target=/usr/src/tex,type=bind dxjoke/tectonic-docker /bin/sh -c "tectonic document.tex"; \
done
#
# CI
#
ci-test-android:
@docker run -it --rm -v $$PWD/android:/root/tmp budtmo/docker-android-x86-9.0 bash -c "(cd tmp && ./gradlew test)"
ci: docker-dbs test-services ci-test-android compile-reports lint-services lint-docker-compose