Skip to content

Commit ca2e838

Browse files
committed
Use proper venv instead of uv --system install
1 parent 51f9cb4 commit ca2e838

2 files changed

Lines changed: 14 additions & 22 deletions

File tree

scripts/vercel-build.sh

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,15 @@ set -e
44

55
echo "=== VERCEL BUILD - PRODUCTION ==="
66

7-
# Install dependencies
8-
echo "Installing dependencies..."
9-
uv pip install --system -r requirements.txt
7+
# Install dependencies into a virtual environment
8+
echo "Creating virtual environment and installing dependencies..."
9+
uv venv --python 3.12 .venv
10+
uv pip install -r requirements.txt
1011

11-
# Create minimal mkdocs wrapper for mike to find
12-
echo "Creating minimal mkdocs wrapper for mike..."
13-
cat > mkdocs << 'EOF'
14-
#!/bin/bash
15-
exec uv run python3 -c "from mkdocs.__main__ import cli; cli()" "$@"
16-
EOF
17-
chmod +x mkdocs
18-
19-
# Add current directory to PATH so mike can find our mkdocs wrapper
20-
export PATH=".:$PATH"
12+
# Add venv bin to PATH so mike/mkdocs are found directly
13+
export PATH="$(pwd)/.venv/bin:$PATH"
2114

22-
echo "mkdocs wrapper created and added to PATH"
15+
echo "Virtual environment created and added to PATH"
2316

2417
# FORCE cleanup of any existing content
2518
echo "Force cleaning any existing directories..."
@@ -89,13 +82,13 @@ build_version() {
8982

9083
echo "Deploying version $version with preserved git history"
9184
if [ -n "$alias" ] && [ -n "$title" ]; then
92-
uv run mike deploy "$version" "$alias" --title="$title"
85+
mike deploy "$version" "$alias" --title="$title"
9386
elif [ -n "$alias" ]; then
94-
uv run mike deploy "$version" "$alias"
87+
mike deploy "$version" "$alias"
9588
elif [ -n "$title" ]; then
96-
uv run mike deploy "$version" --title="$title"
89+
mike deploy "$version" --title="$title"
9790
else
98-
uv run mike deploy "$version"
91+
mike deploy "$version"
9992
fi
10093

10194
echo "Rocky Linux $version deployed successfully with git history preserved"
@@ -116,7 +109,6 @@ git config user.email "webmaster@rockylinux.org"
116109
# Create initial commit
117110
echo "# Rocky Linux Docs Build" > README.md
118111
git add README.md
119-
git add -f mkdocs # Force add mkdocs wrapper even if in gitignore elsewhere
120112
git commit -m "Initial commit for Vercel build $(date)"
121113

122114
# Build each version from its respective branch
@@ -125,13 +117,13 @@ build_version "9" "rocky-9" "" ""
125117
build_version "10" "main" "latest" ""
126118

127119
echo "Setting default version..."
128-
uv run mike set-default latest
120+
mike set-default latest
129121

130122
echo "All versions deployed successfully"
131123

132124
# Verify mike state
133125
echo "Verifying mike deployment..."
134-
uv run mike list
126+
mike list
135127

136128
echo "Extracting built site for Vercel with ROOT + VERSIONED deployment..."
137129

vercel.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"buildCommand": "./scripts/vercel-build.sh",
33
"outputDirectory": "site",
4-
"installCommand": "uv pip install --system -r requirements.txt",
4+
"installCommand": "echo 'Dependencies installed in build script'",
55
"framework": null
66
}

0 commit comments

Comments
 (0)