Skip to content

Commit

Permalink
checkout the healthy
Browse files Browse the repository at this point in the history
  • Loading branch information
getong committed Jun 22, 2024
1 parent 6803d8c commit fb272ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Set up MariaDB 10
uses: getong/mariadb-action@v1.7
uses: getong/mariadb-action@v1.8
with:
mariadb version: 10.4.10
mysql database: test
Expand Down
5 changes: 4 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if [ -n "$INPUT_MYSQL_DATABASE" ]; then
fi

docker_run="$docker_run --health-cmd='healthcheck.sh --connect --innodb_initialized'"
docker_run="$docker_run -d -p $INPUT_HOST_PORT:$INPUT_CONTAINER_PORT docker.io/library/mariadb:$INPUT_MARIADB_VERSION --port=$INPUT_CONTAINER_PORT"
docker_run="$docker_run -d -p $INPUT_HOST_PORT:$INPUT_CONTAINER_PORT mariadb:$INPUT_MARIADB_VERSION --port=$INPUT_CONTAINER_PORT"
docker_run="$docker_run --character-set-server=$INPUT_CHARACTER_SET_SERVER --collation-server=$INPUT_COLLATION_SERVER"

CONTAINER_NAME=$(eval "$docker_run" )
Expand All @@ -44,6 +44,9 @@ while true; do
if [ "$HEALTH" = "unhealthy" ]; then
echo "Container $CONTAINER_NAME is healthy!"
break
else if [ "$HEALTH" = "healthy" ]; then
echo "Container $CONTAINER_NAME is healthy!"
break
else
echo "Container $CONTAINER_NAME is still starting (current status: $HEALTH)"
sleep 1
Expand Down

0 comments on commit fb272ca

Please sign in to comment.