-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgenerate.sh
More file actions
executable file
·116 lines (95 loc) · 2.43 KB
/
Copy pathgenerate.sh
File metadata and controls
executable file
·116 lines (95 loc) · 2.43 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
#!/bin/bash
GIT_MAIN_BRANCH='main'
GIT_REMOTE='upstream'
applyModules() {
for module in $@
do
local api="/api/modules/$module/apply-patch"
echo "curl -o /dev/null -s -w "%{http_code}\n" \
-X POST \
-H "accept: */*" \
-H "Content-Type: application/json" \
-d "$payload" \
"http://localhost:1339""$api""
local status_code=$(curl -o /dev/null -s -w "%{http_code}\n" \
-X POST \
-H "accept: */*" \
-H "Content-Type: application/json" \
-d "$payload" \
"http://localhost:1339""$api")
if [[ $status_code == '40'* || $status_code == '50'* ]]; then
echo "Error when calling API:" "$status_code" "$api"
exit 1
fi;
done
}
if [ "$#" -ne 1 ]; then
show_syntax
fi
payload="$(sed -e "s?SEED4J_SAMPLE_APP_FOLDER?$(pwd)?g" seed4jsample.json)"
echo "*** Checking service health..."
health_status=$(curl -s http://localhost:1339/management/health | jq -r '.status')
if [[ "$health_status" != "UP" ]]; then
echo "Service is not healthy: $health_status"
exit 1
fi
echo "*** Git: update project..."
git switch $GIT_MAIN_BRANCH
git fetch $GIT_REMOTE
git rebase $GIT_REMOTE/$GIT_MAIN_BRANCH
echo "*** Deleting files and folders..."
find . -maxdepth 1 \
-not -name "generate.sh" \
-not -name "release.sh" \
-not -name "seed4jsample.json" \
-type f -delete
rm -rf src
rm -rf node_modules
rm -rf documentation .husky .seed4j .mvn
echo "*** Applying modules..."
applyModules \
"init" \
"maven-java" \
"maven-wrapper" \
"java-base" \
"jacoco-with-min-coverage-check" \
"java-memoizers" \
"java-enums" \
"pagination-domain"
applyModules \
"application-service-hexagonal-architecture-documentation"
applyModules \
"spring-boot" \
"logs-spy" \
"spring-boot-mvc-empty" \
"spring-boot-tomcat" \
"spring-boot-actuator" \
"spring-boot-async" \
"spring-boot-devtools" \
"java-archunit" \
"git-information"
applyModules \
"prettier" \
"typescript" \
"frontend-maven-plugin" \
"vue-core" \
"vue-router"
applyModules \
"sonarqube-java-backend-and-frontend"
applyModules \
"datasource-postgresql" \
"jpa-postgresql" \
"liquibase"
applyModules \
"spring-boot-oauth2" \
"spring-boot-oauth2-account" \
"springdoc-mvc-openapi" \
"springdoc-oauth2"
applyModules \
"spring-boot-cucumber-mvc" \
"spring-boot-cucumber-oauth2-authentication" \
"kipe-expression" \
"kipe-authorization" \
"sample-feature"
npm i
npm run prettier:format