Skip to content

Commit a48a1c1

Browse files
committed
Improve generate.sh script
1 parent 95f14bc commit a48a1c1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

generate.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ applyModules() {
1818
-H "accept: */*" \
1919
-H "Content-Type: application/json" \
2020
-d "$payload" \
21-
"http://localhost:7471""$api""
21+
"http://localhost:1339""$api""
2222

2323
local status_code=$(curl -o /dev/null -s -w "%{http_code}\n" \
2424
-X POST \
2525
-H "accept: */*" \
2626
-H "Content-Type: application/json" \
2727
-d "$payload" \
28-
"http://localhost:7471""$api")
28+
"http://localhost:1339""$api")
2929

3030
if [[ $status_code == '40'* || $status_code == '50'* ]]; then
3131
echo "Error when calling API:" "$status_code" "$api"
@@ -41,6 +41,14 @@ fi
4141
version=$1
4242
payload="$(sed -e "s?SEED4J_SAMPLE_APP_FOLDER?$(pwd)?g" seed4jsample.json)"
4343

44+
echo "*** Checking service health..."
45+
health_status=$(curl -s http://localhost:1339/management/health | jq -r '.status')
46+
47+
if [[ "$health_status" != "UP" ]]; then
48+
echo "Service is not healthy: $health_status"
49+
exit 1
50+
fi
51+
4452
echo "*** Git: update project..."
4553
git switch $GIT_MAIN_BRANCH
4654
git fetch $GIT_REMOTE

0 commit comments

Comments
 (0)