Skip to content

Commit

Permalink
retry docker verbose if fail
Browse files Browse the repository at this point in the history
  • Loading branch information
mixmix committed Oct 24, 2024
1 parent bae3b08 commit bfe0c75
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
4 changes: 2 additions & 2 deletions dev/bin/remove-db.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env bash

rm -rf .entropy
docker compose --file dev/docker-scripts/four-nodes.yaml --progress quiet down
docker compose --file dev/docker-scripts/one-node-no-tss.yaml --progress quiet down
./dev/bin/spin-down.sh four-nodes
./dev/bin/spin-down.sh one-node-no-tss
17 changes: 14 additions & 3 deletions dev/bin/spin-down.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#! /usr/bin/env bash
source ./dev/bin/ENTROPY_CORE_VERSION.sh

docker_file=./dev/docker-scripts/$1.yaml
docker compose --file $docker_file --progress quiet down
docker compose --file $docker_file logs
FILE="dev/docker-scripts/$1.yaml"

spin_down() {
docker compose --file "$FILE" "$@" down

if [ $? -ne 0 ]; then
echo "Error: 'docker compose down' failed."
echo "Retrying verbose:"
docker compose --file "$FILE" down
fi
}

spin_down --progress quiet
docker compose --file $FILE logs
19 changes: 15 additions & 4 deletions dev/bin/spin-up.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
#! /usr/bin/env bash
source ./dev/bin/ENTROPY_CORE_VERSION.sh

docker_file=dev/docker-scripts/$1.yaml
if [ $GITHUB_WORKSPACE ]; then
docker compose --file $docker_file up --detach --quiet-pull;
FILE="dev/docker-scripts/$1.yaml"

spin_up() {
docker compose --file "$FILE" "$@" up --detach

if [ $? -ne 0 ]; then
echo "Error: 'docker compose up' failed."
echo "Retrying verbose:"
docker compose --file "$FILE" up --detach
fi
}

if [ -n "$GITHUB_WORKSPACE" ]; then
spin_up --progress quiet --quiet-pull
else
docker compose --file $docker_file --progress quiet up --detach;
spin_up --progress quiet
fi

0 comments on commit bfe0c75

Please sign in to comment.