From 6b53004eb185685e4662fac9ba7234401a7fd1da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrej=20Buko=C5=A1ek?= Date: Wed, 29 Nov 2023 09:57:13 +0100 Subject: [PATCH] fix: Fix unbound variable in cleanup function in start.sh --- .github/workflows/docker-dev.yml | 2 +- docker/common/start.sh | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-dev.yml b/.github/workflows/docker-dev.yml index 4b5d165c..7dc46920 100644 --- a/.github/workflows/docker-dev.yml +++ b/.github/workflows/docker-dev.yml @@ -48,7 +48,7 @@ jobs: load: true - name: Test - timeout-minutes: 3 + timeout-minutes: 2 working-directory: docker/${{ matrix.docker_image }} run: ./test.sh diff --git a/docker/common/start.sh b/docker/common/start.sh index 7e8afbe4..aaff704c 100755 --- a/docker/common/start.sh +++ b/docker/common/start.sh @@ -27,9 +27,16 @@ export BEACON_BACKEND=${BEACON_BACKEND:-mock} OASIS_NODE_SOCKET=${OASIS_NODE_DATADIR}/net-runner/network/client-0/internal.sock OASIS_KM_SOCKET=${OASIS_NODE_DATADIR}/net-runner/network/keymanager-0/internal.sock +OASIS_WEB3_GATEWAY_PID="" +OASIS_NODE_PID="" + function cleanup { - kill -9 $OASIS_WEB3_GATEWAY_PID - kill -9 $OASIS_NODE_PID + if [[ -n "${OASIS_WEB3_GATEWAY_PID}" ]]; then + kill -9 ${OASIS_WEB3_GATEWAY_PID} + fi + if [[ -n "${OASIS_NODE_PID}" ]]; then + kill -9 ${OASIS_NODE_PID} + fi } trap cleanup INT TERM EXIT