Skip to content

Commit

Permalink
fix: wait for services to be healthy
Browse files Browse the repository at this point in the history
Fixes wowu#38
  • Loading branch information
mbrodala authored Dec 11, 2024
1 parent 7487c2d commit 8a849ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker-rollout
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ healthcheck() {

scale() {
# shellcheck disable=SC2086 # COMPOSE_FILES and ENV_FILES must be unquoted to allow multiple files
$COMPOSE_COMMAND $COMPOSE_FILES $ENV_FILES up --detach --scale "$1=$2" --no-recreate "$1"
$COMPOSE_COMMAND $COMPOSE_FILES $ENV_FILES up --wait --scale "$1=$2" --no-recreate "$1"
}

main() {
# shellcheck disable=SC2086 # COMPOSE_FILES and ENV_FILES must be unquoted to allow multiple files
if [ -z "$($COMPOSE_COMMAND $COMPOSE_FILES $ENV_FILES ps --quiet "$SERVICE")" ]; then
echo "==> Service '$SERVICE' is not running. Starting the service."
$COMPOSE_COMMAND $COMPOSE_FILES $ENV_FILES up --detach --no-recreate "$SERVICE"
$COMPOSE_COMMAND $COMPOSE_FILES $ENV_FILES up --wait --no-recreate "$SERVICE"
exit 0
fi

Expand Down

0 comments on commit 8a849ca

Please sign in to comment.