From 9eb628314e49a3517d591f0259b301540bfc911d Mon Sep 17 00:00:00 2001 From: Glenn Date: Sun, 5 May 2024 19:14:14 +0200 Subject: [PATCH] fix: workdir may not be available at startup --- postdeploy.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/postdeploy.sh b/postdeploy.sh index 3cd411d..145f7b1 100755 --- a/postdeploy.sh +++ b/postdeploy.sh @@ -3,7 +3,15 @@ set -u set -e -cd /var/www/html +WORKDIR=/var/www/html +counter=0 +while [ ! -d "$WORKDIR" ] && [ "$counter" -lt 120 ]; do + echo "GYR:POSTDEPLOY:WAITING" + counter=$((counter+1)) + sleep 1 +done +cd "$WORKDIR" || exit 1 + echo "GYR:POSTDEPLOY:START ($(pwd))" find . -maxdepth 1 echo "GYR:POSTDEPLOY:UPGRADE"