-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
37 lines (30 loc) · 851 Bytes
/
run.sh
File metadata and controls
37 lines (30 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
set -e
if [ -z "$REPO_URL" ] || [ -z "$BRANCH" ]; then
echo "Error: REPO_URL and BRANCH must be set."
exit 1
fi
echo "Cloning repo: $REPO_URL branch: $BRANCH"
# Always fresh clone into /app/src
rm -rf /app/src
git clone --branch "$BRANCH" --single-branch "$REPO_URL" /app/src
cd /app/src
# DEBUG: list repo contents
echo "Contents of /app/src:"
ls -al
echo "Contents of ./scripts:"
ls -al ./scripts
yarn install --frozen-lockfile
cd /app/src
# Run data download script
if [ -f "./scripts/download-data.sh" ]; then
echo "Running download-data.sh..."
chmod +x ./scripts/download-data.sh
bash ./scripts/download-data.sh
else
echo "Warning: scripts/download-data.sh not found, skipping"
fi
# Build the app
echo "Building Next.js app..."
NODE_OPTIONS="--max_old_space_size=4096" yarn build
cp -r /app/src/out /app/