mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2025-12-08 20:46:44 +03:00
refactor: remove bun setup for pre-built images and streamline database initialization scripts
This commit is contained in:
@@ -5,11 +5,8 @@ set -e
|
|||||||
# Ensure data directory exists
|
# Ensure data directory exists
|
||||||
mkdir -p /app/data
|
mkdir -p /app/data
|
||||||
|
|
||||||
# If bun is available, run setup (for dev images)
|
# Skip dependency installation entirely for pre-built images
|
||||||
if command -v bun >/dev/null 2>&1; then
|
# Dependencies are already installed during the Docker build process
|
||||||
echo "Running bun setup (if needed)..."
|
|
||||||
bun run setup || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Initialize the database if it doesn't exist
|
# Initialize the database if it doesn't exist
|
||||||
if [ ! -f "/app/data/gitea-mirror.db" ]; then
|
if [ ! -f "/app/data/gitea-mirror.db" ]; then
|
||||||
@@ -18,6 +15,8 @@ if [ ! -f "/app/data/gitea-mirror.db" ]; then
|
|||||||
bun dist/scripts/init-db.js
|
bun dist/scripts/init-db.js
|
||||||
elif [ -f "dist/scripts/manage-db.js" ]; then
|
elif [ -f "dist/scripts/manage-db.js" ]; then
|
||||||
bun dist/scripts/manage-db.js init
|
bun dist/scripts/manage-db.js init
|
||||||
|
elif [ -f "scripts/manage-db.ts" ]; then
|
||||||
|
bun scripts/manage-db.ts init
|
||||||
else
|
else
|
||||||
echo "Warning: Could not find database initialization scripts in dist/scripts."
|
echo "Warning: Could not find database initialization scripts in dist/scripts."
|
||||||
echo "Creating and initializing database manually..."
|
echo "Creating and initializing database manually..."
|
||||||
@@ -155,6 +154,8 @@ else
|
|||||||
bun dist/scripts/fix-db-issues.js
|
bun dist/scripts/fix-db-issues.js
|
||||||
elif [ -f "dist/scripts/manage-db.js" ]; then
|
elif [ -f "dist/scripts/manage-db.js" ]; then
|
||||||
bun dist/scripts/manage-db.js fix
|
bun dist/scripts/manage-db.js fix
|
||||||
|
elif [ -f "scripts/manage-db.ts" ]; then
|
||||||
|
bun scripts/manage-db.ts fix
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run database migrations
|
# Run database migrations
|
||||||
|
|||||||
Reference in New Issue
Block a user