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

Docker + run scripts minor fixes #1686

Merged
merged 3 commits into from
May 7, 2024
Merged
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
36 changes: 15 additions & 21 deletions dev-peerdb.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
#!/bin/sh
if test -z "$USE_PODMAN"
set -Eeu

DOCKER="docker"
EXTRA_ARGS="--no-attach temporal --no-attach pyroscope --no-attach temporal-ui"

if test -n "${USE_PODMAN:=}"
then
if ! command -v docker &> /dev/null
then
if command -v podman-compose
then
echo "docker could not be found on PATH, using podman-compose"
# 0 is found, checking for not found so we check for podman then
if $(docker compose &>/dev/null) && [ $? -ne 0 ]; then
if $(podman compose &>/dev/null) && [ $? -eq 0 ]; then
echo "docker could not be found on PATH, using podman compose"
USE_PODMAN=1
else
echo "docker could not be found on PATH"
echo "docker compose could not be found on PATH"
exit 1
fi
fi
fi

if test -z "$USE_PODMAN"
then
DOCKER="docker compose"
EXTRA_ARGS="--no-attach temporal --no-attach pyroscope --no-attach temporal-ui"
else
DOCKER="podman-compose --podman-run-args=--replace"
EXTRA_ARGS=""
fi

# check if peerdb_network exists if not create it
if ! $DOCKER network inspect peerdb_network &> /dev/null
then
$DOCKER network create peerdb_network
if test -n "$USE_PODMAN"; then
DOCKER="podman"
EXTRA_ARGS="--podman-run-args=--replace"
fi

export PEERDB_VERSION_SHA_SHORT=local-$(git rev-parse --short HEAD)
exec $DOCKER -f docker-compose-dev.yml up --build $EXTRA_ARGS
exec $DOCKER compose -f docker-compose-dev.yml up --build $EXTRA_ARGS
1 change: 0 additions & 1 deletion docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,5 +221,4 @@ volumes:

networks:
default:
external: true
name: peerdb_network
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,5 +192,4 @@ volumes:

networks:
default:
external: true
name: peerdb_network
25 changes: 16 additions & 9 deletions run-peerdb.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
#!/bin/sh
set -Eeu

if ! command -v docker &> /dev/null
DOCKER="docker"

if test -n "${USE_PODMAN:=}"
then
echo "docker could not be found on PATH"
exit 1
if ! (command -v docker &> /dev/null); then
if (command -v podman &> /dev/null); then
echo "docker could not be found on PATH, using podman"
USE_PODMAN=1
else
echo "docker could not be found on PATH"
exit 1
fi
fi
fi

# check if peerdb_network exists if not create it
if ! docker network inspect peerdb_network &> /dev/null
then
docker network create peerdb_network
if test -n "$USE_PODMAN"; then
DOCKER="podman"
fi

docker compose pull
docker compose -f docker-compose.yml up --no-attach catalog --no-attach temporal --no-attach temporal-ui --no-attach temporal-admin-tools
$DOCKER compose pull
exec $DOCKER compose -f docker-compose.yml up --no-attach catalog --no-attach temporal --no-attach temporal-ui --no-attach temporal-admin-tools
Loading