diff --git a/scripts/docker-testnet/build.sh b/scripts/docker-testnet/build.sh index 22babc04c84..0b038e17e4b 100755 --- a/scripts/docker-testnet/build.sh +++ b/scripts/docker-testnet/build.sh @@ -2,7 +2,13 @@ set -eux -pushd ../.. +export DOCKERTESTNETDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +MULTIVERSXTESTNETSCRIPTSDIR="$(dirname "$DOCKERTESTNETDIR")/testnet" + +source "$DOCKERTESTNETDIR/variables.sh" + +cd ${MULTIVERSXDIR} docker build -f docker/seednode/Dockerfile . -t seednode:dev diff --git a/scripts/docker-testnet/start.sh b/scripts/docker-testnet/start.sh index 1bf10af1840..f68e49d62d4 100755 --- a/scripts/docker-testnet/start.sh +++ b/scripts/docker-testnet/start.sh @@ -2,7 +2,9 @@ set -eux -file_path="./tmp/stopped_containers" +export DOCKERTESTNETDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +file_path="${DOCKERTESTNETDIR}/tmp/stopped_containers" # Check if the file exists if [ ! -f "$file_path" ]; then @@ -15,4 +17,4 @@ while IFS= read -r line; do docker start $line done < "$file_path" -rmdir ./tmp \ No newline at end of file +rm -rf "${DOCKERTESTNETDIR}/tmp" \ No newline at end of file diff --git a/scripts/docker-testnet/stop.sh b/scripts/docker-testnet/stop.sh index 89486f82044..6c5054570dc 100755 --- a/scripts/docker-testnet/stop.sh +++ b/scripts/docker-testnet/stop.sh @@ -11,11 +11,11 @@ source "$MULTIVERSXTESTNETSCRIPTSDIR/variables.sh" # Get the IDs of containers attached to the network export CONTAINER_IDS=$(docker network inspect -f '{{range $k, $v := .Containers}}{{printf "%s\n" $k}}{{end}}' "$DOCKER_NETWORK_NAME") -mkdir -p ./tmp +mkdir -p "$MULTIVERSXTESTNETSCRIPTSDIR/tmp" # Stop each container echo "Stopping containers..." for CONTAINER_ID in $CONTAINER_IDS; do docker stop "$CONTAINER_ID" - echo "$CONTAINER_ID" >> ./tmp/stopped_containers + echo "$CONTAINER_ID" >> "$MULTIVERSXTESTNETSCRIPTSDIR/tmp/stopped_containers" done \ No newline at end of file