Skip to content

Commit

Permalink
fix(planner/nodejs): Fix build failed when need puppeteer and no buil…
Browse files Browse the repository at this point in the history
…d script
  • Loading branch information
yuaanlin committed Sep 11, 2023
1 parent 1bd24aa commit 01b406b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/nodejs/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,12 @@ func GetBuildCmd(ctx *nodePlanContext) string {

needPuppeteer := DetermineNeedPuppeteer(ctx)
if needPuppeteer {
buildCmd = `apt-get update && apt-get install -y libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgbm1 libasound2 libpangocairo-1.0-0 libxss1 libgtk-3-0 libxshmfence1 libglu1 && groupadd -r puppeteer && useradd -r -g puppeteer -G audio,video puppeteer && chown -R puppeteer:puppeteer /src && mkdir /home/puppeteer && chown -R puppeteer:puppeteer /home/puppeteer && USER puppeteer`
aptCmd := `apt-get update && apt-get install -y libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgbm1 libasound2 libpangocairo-1.0-0 libxss1 libgtk-3-0 libxshmfence1 libglu1 && groupadd -r puppeteer && useradd -r -g puppeteer -G audio,video puppeteer && chown -R puppeteer:puppeteer /src && mkdir /home/puppeteer && chown -R puppeteer:puppeteer /home/puppeteer
USER puppeteer`
if buildCmd != "" {
buildCmd += " && " + buildCmd
buildCmd = aptCmd + "\nRUN" + buildCmd
} else {
buildCmd = aptCmd
}
}

Expand Down

0 comments on commit 01b406b

Please sign in to comment.