forked from thombergs/code-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-all.sh
executable file
·200 lines (185 loc) · 5.63 KB
/
build-all.sh
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#!/bin/bash
MODULE=$1
MAIN_DIR=$PWD
build_gradle_module() {
MODULE_PATH=$1
echo ""
echo "+++"
echo "+++ BUILDING MODULE $MODULE_PATH"
echo "+++"
cd $MODULE_PATH && {
chmod +x gradlew
./gradlew clean build
if [ $? -ne 0 ]
then
echo ""
echo "+++"
echo "+++ BUILDING MODULE $MODULE_PATH FAILED"
echo "+++"
exit 1
else
echo ""
echo "+++"
echo "+++ BUILDING MODULE $MODULE_PATH SUCCESSFUL"
echo "+++"
fi
cd $MAIN_DIR
}
}
run_gradle_task() {
MODULE_PATH=$1
TASK_NAME=$2
echo ""
echo "+++"
echo "+++ RUNNING GRADLE TASK $MODULE_PATH : $TASK_NAME"
echo "+++"
cd $MODULE_PATH && {
chmod +x gradlew
./gradlew $TASK_NAME
if [ $? -ne 0 ]
then
echo ""
echo "+++"
echo "+++ GRADLE TASK $MODULE_PATH : $TASK_NAME FAILED"
echo "+++"
exit 1
else
echo ""
echo "+++"
echo "+++ GRADLE TASK $MODULE_PATH : $TASK_NAME SUCCESSFUL"
echo "+++"
fi
cd $MAIN_DIR
}
}
build_maven_module() {
MODULE_PATH=$1
echo ""
echo "+++"
echo "+++ BUILDING MODULE $MODULE_PATH"
echo "+++"
cd $MODULE_PATH && {
chmod +x mvnw
./mvnw clean package
if [ $? -ne 0 ]
then
echo ""
echo "+++"
echo "+++ BUILDING MODULE $MODULE_PATH FAILED"
echo "+++"
exit 1
else
echo ""
echo "+++"
echo "+++ BUILDING MODULE $MODULE_PATH SUCCESSFUL"
echo "+++"
fi
cd $MAIN_DIR
}
}
if [[ "$MODULE" == "module5" ]]
then
# ADD NEW MODULES HERE
# (add new modules above the rest so you get quicker feedback if it fails)
build_maven_module "core-java/service-provider-interface"
build_gradle_module "spring-boot/hazelcast/hazelcast-embedded-cache"
build_gradle_module "spring-boot/hazelcast/hazelcast-client-server"
build_maven_module "core-java/heapdump"
build_gradle_module "aws/s3"
build_maven_module "graphql"
build_gradle_module "spring-boot/exception-handling"
build_maven_module "spring-boot/spring-boot-elasticsearch"
build_gradle_module "spring-boot/spring-boot-mocking-modules"
build_gradle_module "spring-boot/specification"
build_gradle_module "spring-boot/hibernate-search"
build_maven_module "core-java/streams/fileswithstreams"
build_maven_module "spring-boot/spring-boot-health-check"
build_maven_module "spring-boot/spring-boot-logging-2"
build_maven_module "spring-boot/spring-boot-docker"
build_maven_module "spring-boot/spring-component-scanning"
build_gradle_module "spring-boot/devtools-demo"
build_gradle_module "spring-boot/cache"
build_gradle_module "spring-boot/bean-lifecycle"
build_gradle_module "spring-boot/request-response/client"
build_gradle_module "spring-boot/request-response/server"
echo ""
echo "+++"
echo "+++ MODULE 5 SUCCESSFUL"
echo "+++"
fi
if [[ "$MODULE" == "module1" ]]
then
build_maven_module "spring-boot/spring-boot-cookie-demo"
build_maven_module "spring-boot/spring-boot-kafka"
build_gradle_module "spring-boot/spring-boot-springdoc"
build_maven_module "spring-boot/dependency-injection"
build_maven_module "spring-boot/spring-boot-openapi"
build_maven_module "spring-boot/data-migration/liquibase"
build_gradle_module "spring-boot/boundaries"
build_gradle_module "spring-boot/argumentresolver"
build_gradle_module "spring-boot/data-migration/flyway"
run_gradle_task "spring-boot/thymeleaf-vue" "clean npmInstall build"
build_gradle_module "spring-boot/conditionals"
build_gradle_module "spring-boot/configuration"
echo ""
echo "+++"
echo "+++ MODULE 1 SUCCESSFUL"
echo "+++"
fi
if [[ "$MODULE" == "module2" ]]
then
build_gradle_module "solid/isp"
build_maven_module "solid/lsp"
build_maven_module "resilience4j/retry"
build_maven_module "resilience4j/ratelimiter"
build_maven_module "resilience4j/timelimiter"
build_maven_module "resilience4j/bulkhead"
build_maven_module "resilience4j/circuitbreaker"
build_gradle_module "spring-data/spring-data-jdbc-converter"
build_gradle_module "reactive"
build_gradle_module "junit/assumptions"
build_gradle_module "logging"
build_gradle_module "pact/pact-feign-consumer"
echo ""
echo "+++"
echo "+++ MODULE 2 SUCCESSFUL"
echo "+++"
fi
if [[ "$MODULE" == "module3" ]]
then
build_maven_module "aws/localstack"
build_gradle_module "pact/pact-spring-provider"
build_gradle_module "patterns"
build_gradle_module "spring-cloud/feign-with-spring-data-rest"
build_gradle_module "spring-cloud/sleuth-downstream-service"
build_gradle_module "spring-cloud/sleuth-upstream-service"
build_gradle_module "spring-cloud/spring-cloud-contract-provider" # has to run before consumer
build_gradle_module "spring-cloud/spring-cloud-contract-consumer"
build_gradle_module "spring-data/spring-data-rest-associations"
build_gradle_module "spring-data/spring-data-rest-springfox"
build_gradle_module "tools/jacoco"
echo ""
echo "+++"
echo "+++ MODULE 3 SUCCESSFUL"
echo "+++"
fi
if [[ "$MODULE" == "module4" ]]
then
build_gradle_module "spring-boot/mocking"
build_gradle_module "spring-boot/modular"
build_gradle_module "spring-boot/paging"
build_gradle_module "spring-boot/rabbitmq-event-brokering"
build_gradle_module "spring-boot/spring-boot-logging"
build_gradle_module "spring-boot/spring-boot-testing"
build_gradle_module "spring-boot/starter"
build_gradle_module "spring-boot/startup"
build_gradle_module "spring-boot/static"
build_gradle_module "spring-boot/validation"
build_gradle_module "spring-boot/profiles"
build_gradle_module "spring-boot/password-encoding"
build_gradle_module "spring-boot/testcontainers"
echo ""
echo "+++"
echo "+++ MODULE 4 SUCCESSFUL"
echo "+++"
fi