1
0
forked from baron/baron-sso

공유 node_modules 설치 충돌 방지

This commit is contained in:
2026-05-19 15:13:36 +09:00
parent 611730f22a
commit 598f6ff9d1
4 changed files with 69 additions and 21 deletions

View File

@@ -51,6 +51,21 @@ ensure_frontend_dependencies() {
return 0
fi
acquire_install_lock() {
lock_file="$WORKSPACE_DIR/.baron-deps-install.lock"
if command -v flock >/dev/null 2>&1; then
exec 9>"$lock_file"
flock 9
return 0
fi
while ! mkdir "$lock_file" 2>/dev/null; do
sleep 1
done
trap 'rmdir "$lock_file" >/dev/null 2>&1 || true' EXIT INT TERM
}
if command -v sha256sum >/dev/null 2>&1; then
deps_hash="$(sha256sum "$WORKSPACE_DIR/package.json" "$LOCK_FILE" 2>/dev/null | sha256sum | awk '{print $1}')"
else
@@ -61,6 +76,7 @@ ensure_frontend_dependencies() {
if [ "$installed_hash" != "$deps_hash" ]; then
echo "Installing frontend dependencies..."
acquire_install_lock
if [ "$WORKSPACE_DIR" = "/workspace/common" ]; then
(cd /workspace/common && pnpm install --filter "${APP_WORKSPACE_FILTER}..." --frozen-lockfile --ignore-scripts)
else