Skip build for lightweight stages (analyse, architect, release, maintenance)
These stages only read code and post comments — no need for npm install, frontend build, Playwright, or migrations. Saves several minutes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d220623a9f
commit
9bca465565
|
|
@ -460,25 +460,31 @@ resource "coder_agent" "main" {
|
|||
# Switch to develop branch if it exists
|
||||
git fetch origin develop 2>/dev/null && git checkout develop 2>/dev/null || true
|
||||
|
||||
# Install deps if package.json exists
|
||||
if [ -f package.json ]; then
|
||||
npm ci --legacy-peer-deps || npm ci
|
||||
fi
|
||||
# Lightweight stages only need the code, not a full build
|
||||
LIGHT_STAGES="analyse architect release maintenance"
|
||||
if echo "$LIGHT_STAGES" | grep -qw "$TASK_TYPE"; then
|
||||
echo "Lightweight stage ($TASK_TYPE) — skipping build"
|
||||
else
|
||||
# Install deps if package.json exists
|
||||
if [ -f package.json ]; then
|
||||
npm ci --legacy-peer-deps || npm ci
|
||||
fi
|
||||
|
||||
# Install frontend deps if present
|
||||
if [ -f frontend/package.json ]; then
|
||||
cd frontend && npm ci && cd ..
|
||||
npm run build:frontend 2>/dev/null || true
|
||||
fi
|
||||
# Install frontend deps if present
|
||||
if [ -f frontend/package.json ]; then
|
||||
cd frontend && npm ci && cd ..
|
||||
npm run build:frontend 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Install Playwright if needed
|
||||
if grep -q "playwright" package.json 2>/dev/null; then
|
||||
npx playwright install chromium
|
||||
fi
|
||||
# Install Playwright if needed
|
||||
if grep -q "playwright" package.json 2>/dev/null; then
|
||||
npx playwright install chromium
|
||||
fi
|
||||
|
||||
# Apply local migrations if script exists
|
||||
if npm run --silent db:migrate:local 2>/dev/null; then
|
||||
echo "Local migrations applied"
|
||||
# Apply local migrations if script exists
|
||||
if npm run --silent db:migrate:local 2>/dev/null; then
|
||||
echo "Local migrations applied"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue