Skip to content

Commit

Permalink
wip: attempt logging in healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
exaby73 committed Jul 23, 2024
1 parent 6c3165d commit c14a7cf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
13 changes: 13 additions & 0 deletions .github/scripts/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -e

echo "$(date): Attempting health check..."
HEALTH_STATUS=$(curl -s -H "Authorization: Basic bmVvNGo6dGVzdHRlc3Q=" localhost:7474/db/system/cluster/status | tee /proc/1/fd/1 | grep -oP '"healthy":\s*\K[^,}]*' | sed 's/"//g')

if [ "$HEALTH_STATUS" = "true" ]; then
echo "$(date): Neo4j is healthy!"
exit 0
else
echo "$(date): Neo4j is not healthy yet."
exit 1
fi
8 changes: 4 additions & 4 deletions .github/workflows/integration-test-cluster-neo4j-5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
NEO4J_AUTH: neo4j/testtest
options: >-
--hostname server1
--health-cmd "curl -s -H 'Authorization: Basic bmVvNGo6dGVzdHRlc3Q=' localhost:7474/db/system/cluster/status | grep -q '\"healthy\":true' || exit 1"
--health-cmd "../scripts/healthcheck.sh"
--health-start-period "60s"
--health-interval "30s"
--health-timeout "15s"
Expand All @@ -74,7 +74,7 @@ jobs:
NEO4J_AUTH: neo4j/testtest
options: >-
--hostname server2
--health-cmd "curl -s -H 'Authorization: Basic bmVvNGo6dGVzdHRlc3Q=' localhost:7474/db/system/cluster/status | grep -q '\"healthy\":true' || exit 1"
--health-cmd "../scripts/healthcheck.sh"
--health-start-period "60s"
--health-interval "30s"
--health-timeout "15s"
Expand All @@ -95,7 +95,7 @@ jobs:
NEO4J_AUTH: neo4j/testtest
options: >-
--hostname server3
--health-cmd "curl -s -H 'Authorization: Basic bmVvNGo6dGVzdHRlc3Q=' localhost:7474/db/system/cluster/status | grep -q '\"healthy\":true' || exit 1"
--health-cmd "../scripts/healthcheck.sh"
--health-start-period "60s"
--health-interval "30s"
--health-timeout "15s"
Expand All @@ -116,7 +116,7 @@ jobs:
NEO4J_AUTH: neo4j/testtest
options: >-
--hostname read-server4
--health-cmd "curl -s -H 'Authorization: Basic bmVvNGo6dGVzdHRlc3Q=' localhost:7474/db/system/cluster/status | grep -q '\"healthy\":true' || exit 1"
--health-cmd "../scripts/healthcheck.sh"
--health-start-period "60s"
--health-interval "30s"
--health-timeout "15s"
Expand Down

0 comments on commit c14a7cf

Please sign in to comment.