Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quieten down docker #425

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 down 2> /dev/null
docker compose --file dev/docker-scripts/one-node-no-tss.yaml down 2> /dev/null
./dev/bin/spin-down.sh four-nodes
./dev/bin/spin-down.sh one-node-no-tss
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this works, but it adds a call docker compose --file "$FILE" logs 🤷

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 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
}
Comment on lines +6 to +14
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this and here's how it looked when if fails (make it fail by editing ENTROPY_CORE_VERSION)

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes docker is good and exits with an exit code if it hit any problems...


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