Fixed deployment
All checks were successful
Deploy SingleChat / deploy (push) Successful in 22s

This commit is contained in:
Torsten Schulz (local)
2026-06-15 16:46:10 +02:00
parent e9aef0050a
commit bbb025be63

View File

@@ -10,7 +10,8 @@ RUN_USER="${RUN_USER:-www-data}"
RUN_GROUP="${RUN_GROUP:-www-data}"
DEPLOY_USER="${DEPLOY_USER:-${SUDO_USER:-$(id -un)}}"
DEPLOY_GROUP="${DEPLOY_GROUP:-$(id -gn "$DEPLOY_USER")}"
LOCK_FILE="${LOCK_FILE:-/tmp/actualize-singlechat.lock}"
LOCK_DIR="${LOCK_DIR:-/tmp/actualize-singlechat}"
LOCK_FILE="${LOCK_FILE:-$LOCK_DIR/deploy.lock}"
NPM_CACHE_DIR="${NPM_CACHE_DIR:-$APP_DIR/.npm-cache}"
log() {
@@ -42,6 +43,10 @@ if [ "$(id -u)" -ne 0 ]; then
need_cmd sudo
fi
mkdir -p "$LOCK_DIR"
if [ "$(id -u)" -eq 0 ]; then
chown "$DEPLOY_USER:$DEPLOY_GROUP" "$LOCK_DIR" 2>/dev/null || true
fi
exec 9>"$LOCK_FILE"
if ! flock -n 9; then
echo "Deployment laeuft bereits: $LOCK_FILE" >&2