Skip to content

Commit 2145df0

Browse files
committed
Use docker healthcheck for authentik
1 parent 331c761 commit 2145df0

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

scripts/ci/fulltest-cypress

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ bash "$DIR/../wait-healthy" "$(docker-compose ps --all -q fullstack)" 120
7979

8080
# Wait for authentik to be healthy, if it exists as a compose service
8181
if [ "$(docker-compose ps --all -q authentik)" != "" ]; then
82-
bash "$DIR/../wait-healthy" "$(docker-compose ps --all -q authentik)" 90
82+
bash "$DIR/../wait-healthy" "$(docker-compose ps --all -q authentik)" 90 'true'
8383
fi
8484

8585
# Run tests

scripts/wait-healthy

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,24 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
55

66
if [ "$1" == "" ]; then
77
echo "Waits for a docker container to be healthy."
8-
echo "Usage: $0 docker-container 30"
8+
echo " Usage: $0 docker-container 30"
9+
echo "or use the third parameter to use the docker healthcheck instead of the internal one."
10+
echo " Usage: $0 docker-container 30 true"
911
exit 1
1012
fi
1113

1214
SERVICE=$1
1315
LIMIT=${2:-90}
16+
USE_DOCKER_HEALTHCHECK=${3:-false}
1417

1518
echo -e "${BLUE}${CYAN}Waiting for healthy: ${YELLOW}${SERVICE}${RESET}"
1619

1720
is_up() {
18-
docker exec "$SERVICE" /bin/healthcheck.sh
21+
if [ "$USE_DOCKER_HEALTHCHECK" == "true" ]; then
22+
docker inspect --format='{{.State.Health.Status}}' "$SERVICE" | grep -qi "healthy"
23+
else
24+
docker exec "$SERVICE" /bin/healthcheck.sh
25+
fi
1926
}
2027

2128
i=0

0 commit comments

Comments
 (0)