forked from baron/baron-sso
chore: 모노레포 구축에 따른 Docker 컨테이너 및 런타임 스크립트 대응
This commit is contained in:
@@ -36,21 +36,35 @@ if [ "${1:-}" = "--print-mode" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
ensure_frontend_dependencies() {
|
ensure_frontend_dependencies() {
|
||||||
if [ ! -f package.json ] || [ ! -f package-lock.json ]; then
|
# If common workspace exists, manage dependencies from there
|
||||||
|
if [ -d /common ] && [ -f /common/package.json ]; then
|
||||||
|
WORKSPACE_DIR="/common"
|
||||||
|
LOCK_FILE="/common/pnpm-lock.yaml"
|
||||||
|
else
|
||||||
|
WORKSPACE_DIR="."
|
||||||
|
LOCK_FILE="package-lock.json"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$WORKSPACE_DIR/package.json" ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v sha256sum >/dev/null 2>&1; then
|
if command -v sha256sum >/dev/null 2>&1; then
|
||||||
deps_hash="$(sha256sum package.json package-lock.json | sha256sum | awk '{print $1}')"
|
deps_hash="$(sha256sum "$WORKSPACE_DIR/package.json" "$LOCK_FILE" 2>/dev/null | sha256sum | awk '{print $1}')"
|
||||||
else
|
else
|
||||||
deps_hash="$(cksum package.json package-lock.json | cksum | awk '{print $1}')"
|
deps_hash="$(cksum "$WORKSPACE_DIR/package.json" "$LOCK_FILE" 2>/dev/null | cksum | awk '{print $1}')"
|
||||||
fi
|
fi
|
||||||
deps_stamp="node_modules/.baron-deps-hash"
|
deps_stamp="node_modules/.baron-deps-hash"
|
||||||
installed_hash="$(cat "$deps_stamp" 2>/dev/null || true)"
|
installed_hash="$(cat "$deps_stamp" 2>/dev/null || true)"
|
||||||
|
|
||||||
if [ "$installed_hash" != "$deps_hash" ]; then
|
if [ "$installed_hash" != "$deps_hash" ]; then
|
||||||
echo "Installing frontend dependencies from package-lock.json..."
|
echo "Installing frontend dependencies..."
|
||||||
npm ci
|
if [ "$WORKSPACE_DIR" = "/common" ]; then
|
||||||
|
npm install -g pnpm
|
||||||
|
(cd /common && pnpm install)
|
||||||
|
else
|
||||||
|
npm ci
|
||||||
|
fi
|
||||||
mkdir -p node_modules
|
mkdir -p node_modules
|
||||||
printf '%s\n' "$deps_hash" > "$deps_stamp"
|
printf '%s\n' "$deps_hash" > "$deps_stamp"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -321,6 +321,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "${ADMINFRONT_PORT}:5173"
|
- "${ADMINFRONT_PORT}:5173"
|
||||||
volumes:
|
volumes:
|
||||||
|
- ../../common:/common
|
||||||
- ../../adminfront:/app
|
- ../../adminfront:/app
|
||||||
- ./adminfront/vite.config.ts:/app/vite.config.ts:ro
|
- ./adminfront/vite.config.ts:/app/vite.config.ts:ro
|
||||||
- ./adminfront/auth.ts:/app/src/lib/auth.ts:ro
|
- ./adminfront/auth.ts:/app/src/lib/auth.ts:ro
|
||||||
@@ -335,6 +336,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "${DEVFRONT_PORT}:5173"
|
- "${DEVFRONT_PORT}:5173"
|
||||||
volumes:
|
volumes:
|
||||||
|
- ../../common:/common
|
||||||
- ../../devfront:/app
|
- ../../devfront:/app
|
||||||
- ./devfront/vite.config.ts:/app/vite.config.ts:ro
|
- ./devfront/vite.config.ts:/app/vite.config.ts:ro
|
||||||
- ./devfront/auth.ts:/app/src/lib/auth.ts:ro
|
- ./devfront/auth.ts:/app/src/lib/auth.ts:ro
|
||||||
@@ -349,6 +351,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "${ORGFRONT_PORT}:5175"
|
- "${ORGFRONT_PORT}:5175"
|
||||||
volumes:
|
volumes:
|
||||||
|
- ../../common:/common
|
||||||
- ../../orgfront:/app
|
- ../../orgfront:/app
|
||||||
- ./orgfront/vite.config.ts:/app/vite.config.ts:ro
|
- ./orgfront/vite.config.ts:/app/vite.config.ts:ro
|
||||||
- ./orgfront/auth.ts:/app/src/lib/auth.ts:ro
|
- ./orgfront/auth.ts:/app/src/lib/auth.ts:ro
|
||||||
|
|||||||
@@ -36,21 +36,35 @@ if [ "${1:-}" = "--print-mode" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
ensure_frontend_dependencies() {
|
ensure_frontend_dependencies() {
|
||||||
if [ ! -f package.json ] || [ ! -f package-lock.json ]; then
|
# If common workspace exists, manage dependencies from there
|
||||||
|
if [ -d /common ] && [ -f /common/package.json ]; then
|
||||||
|
WORKSPACE_DIR="/common"
|
||||||
|
LOCK_FILE="/common/pnpm-lock.yaml"
|
||||||
|
else
|
||||||
|
WORKSPACE_DIR="."
|
||||||
|
LOCK_FILE="package-lock.json"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$WORKSPACE_DIR/package.json" ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v sha256sum >/dev/null 2>&1; then
|
if command -v sha256sum >/dev/null 2>&1; then
|
||||||
deps_hash="$(sha256sum package.json package-lock.json | sha256sum | awk '{print $1}')"
|
deps_hash="$(sha256sum "$WORKSPACE_DIR/package.json" "$LOCK_FILE" 2>/dev/null | sha256sum | awk '{print $1}')"
|
||||||
else
|
else
|
||||||
deps_hash="$(cksum package.json package-lock.json | cksum | awk '{print $1}')"
|
deps_hash="$(cksum "$WORKSPACE_DIR/package.json" "$LOCK_FILE" 2>/dev/null | cksum | awk '{print $1}')"
|
||||||
fi
|
fi
|
||||||
deps_stamp="node_modules/.baron-deps-hash"
|
deps_stamp="node_modules/.baron-deps-hash"
|
||||||
installed_hash="$(cat "$deps_stamp" 2>/dev/null || true)"
|
installed_hash="$(cat "$deps_stamp" 2>/dev/null || true)"
|
||||||
|
|
||||||
if [ "$installed_hash" != "$deps_hash" ]; then
|
if [ "$installed_hash" != "$deps_hash" ]; then
|
||||||
echo "Installing frontend dependencies from package-lock.json..."
|
echo "Installing frontend dependencies..."
|
||||||
npm ci
|
if [ "$WORKSPACE_DIR" = "/common" ]; then
|
||||||
|
npm install -g pnpm
|
||||||
|
(cd /common && pnpm install)
|
||||||
|
else
|
||||||
|
npm ci
|
||||||
|
fi
|
||||||
mkdir -p node_modules
|
mkdir -p node_modules
|
||||||
printf '%s\n' "$deps_hash" > "$deps_stamp"
|
printf '%s\n' "$deps_hash" > "$deps_stamp"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -36,21 +36,35 @@ if [ "${1:-}" = "--print-mode" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
ensure_frontend_dependencies() {
|
ensure_frontend_dependencies() {
|
||||||
if [ ! -f package.json ] || [ ! -f package-lock.json ]; then
|
# If common workspace exists, manage dependencies from there
|
||||||
|
if [ -d /common ] && [ -f /common/package.json ]; then
|
||||||
|
WORKSPACE_DIR="/common"
|
||||||
|
LOCK_FILE="/common/pnpm-lock.yaml"
|
||||||
|
else
|
||||||
|
WORKSPACE_DIR="."
|
||||||
|
LOCK_FILE="package-lock.json"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$WORKSPACE_DIR/package.json" ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v sha256sum >/dev/null 2>&1; then
|
if command -v sha256sum >/dev/null 2>&1; then
|
||||||
deps_hash="$(sha256sum package.json package-lock.json | sha256sum | awk '{print $1}')"
|
deps_hash="$(sha256sum "$WORKSPACE_DIR/package.json" "$LOCK_FILE" 2>/dev/null | sha256sum | awk '{print $1}')"
|
||||||
else
|
else
|
||||||
deps_hash="$(cksum package.json package-lock.json | cksum | awk '{print $1}')"
|
deps_hash="$(cksum "$WORKSPACE_DIR/package.json" "$LOCK_FILE" 2>/dev/null | cksum | awk '{print $1}')"
|
||||||
fi
|
fi
|
||||||
deps_stamp="node_modules/.baron-deps-hash"
|
deps_stamp="node_modules/.baron-deps-hash"
|
||||||
installed_hash="$(cat "$deps_stamp" 2>/dev/null || true)"
|
installed_hash="$(cat "$deps_stamp" 2>/dev/null || true)"
|
||||||
|
|
||||||
if [ "$installed_hash" != "$deps_hash" ]; then
|
if [ "$installed_hash" != "$deps_hash" ]; then
|
||||||
echo "Installing frontend dependencies from package-lock.json..."
|
echo "Installing frontend dependencies..."
|
||||||
npm ci
|
if [ "$WORKSPACE_DIR" = "/common" ]; then
|
||||||
|
npm install -g pnpm
|
||||||
|
(cd /common && pnpm install)
|
||||||
|
else
|
||||||
|
npm ci
|
||||||
|
fi
|
||||||
mkdir -p node_modules
|
mkdir -p node_modules
|
||||||
printf '%s\n' "$deps_hash" > "$deps_stamp"
|
printf '%s\n' "$deps_hash" > "$deps_stamp"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user