Skip to content

Commit 59d8705

Browse files
authored
Use sudo to ds renderer, fix chromium install/puppeteer (#2488)
* Downgrade ubuntu, add sudo to ds renderer * change mirror * remove libasound2 * update registry * Install chromium * restore ubuntu version
1 parent 64daac1 commit 59d8705

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

scripts/datasheet-rendering/render-datasheets.sh

+15-4
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,24 @@ if [ -n "$CI" ]; then
2323
fc-list | grep "NotoSansSC"
2424
fc-list | grep "NotoSansTC"
2525

26-
apt-get -qq update -y
26+
sudo apt-get -qq update -y
2727
# SEE: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#chrome-headless-doesnt-launch-on-unix
28-
apt-get -qq install -y -o=Dpkg::Use-Pty=0 ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils
28+
sudo apt-get -qq install -y -o=Dpkg::Use-Pty=0 ca-certificates fonts-liberation libasound2 libappindicator3-1 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils
29+
sudo apt-get -qq install -y chromium || sudo apt-get -qq install -y chromium-browser
2930

3031
echo "Running on Node version: `node -v`"
31-
npm install
32-
npx datasheet-renderer config.json
32+
33+
echo "Setting up registry..."
34+
npm config set registry https://registry.npmjs.org/
35+
echo "Registry attuale: $(npm config get registry)"
36+
37+
echo "Installing dependencies..."
38+
export PUPPETEER_SKIP_DOWNLOAD=true
39+
npm install --verbose
40+
export PUPPETEER_EXECUTABLE_PATH=$(which chromium || which chromium-browser)
41+
42+
echo "Running datasheet-renderer..."
43+
time npx datasheet-renderer config.json
3344
exit $?
3445
fi
3546

0 commit comments

Comments
 (0)