Skip to content
Snippets Groups Projects
Commit 7d05f20d authored by nimrod's avatar nimrod
Browse files

Handle errors a little better.

parent f311f190
No related branches found
No related tags found
No related merge requests found
Pipeline #436 failed
#!/bin/sh
set -eu
_check() {
containers="$(until docker-compose ps -q; do true; done)"
# shellcheck disable=SC2086
docker container inspect --format '{{ .State.Health.Status }}' $containers | grep -v '^healthy$'
}
_deploy() {
echo "Deploying to $1" >&2
export DOCKER_HOST="ssh://$1"
......@@ -10,11 +16,11 @@ _deploy() {
for i in $(seq 12)
do
# shellcheck disable=SC2046
docker container inspect --format '{{ .State.Health.Status }}' $(docker-compose ps -q) | grep -v '^healthy$' || break
_check || break
sleep 10
done
# shellcheck disable=SC2046
! docker container inspect --format '{{ .State.Health.Status }}' $(docker-compose ps -q) | grep -v '^healthy$'
! _check
unset DOCKER_HOST
unset RUNNER_NAME
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment