Skip to content

Commit 46b86e4

Browse files
committed
Reactive-Resume: Browserless fix to only install Chromium; remove Python/playwright dep
If we simply delete the unneeded browser dirs in `src/routes` then we don't need to install them. This will save compiling time and a lot of disk space. It's late for me so I haven't tested fully.
1 parent 4fee885 commit 46b86e4

File tree

2 files changed

+26
-28
lines changed

2 files changed

+26
-28
lines changed

ct/reactive-resume.sh

+19-21
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ function update_script() {
3737

3838
msg_info "Updating $APP to v${RELEASE}"
3939
cp /opt/${APP}/.env /opt/rxresume.env
40-
cd /tmp
41-
wget -q "https://github.com/AmruthPillai/Reactive-Resume/archive/refs/tags/v${RELEASE}.zip"
42-
unzip -q v${RELEASE}.zip
43-
cp -r ${APP}-${RELEASE}/* /opt/${APP}
40+
res_tmp=$(mktemp)
41+
rm -rf /opt/${APP}
42+
wget -q "https://github.com/AmruthPillai/Reactive-Resume/archive/refs/tags/v${RELEASE}.zip" -O $res_tmp
43+
unzip -q $res_tmp
44+
mv ${APP}-${RELEASE}/ /opt/${APP}
4445
cd /opt/${APP}
4546
corepack enable
4647
export PUPPETEER_SKIP_DOWNLOAD="true"
4748
export NEXT_TELEMETRY_DISABLED=1
48-
export CI="true"
4949
$STD pnpm install --frozen-lockfile
5050
$STD pnpm run build
5151
$STD pnpm run prisma:generate
@@ -59,35 +59,33 @@ function update_script() {
5959
$STD dpkg -i minio.deb
6060
msg_ok "Updated Minio"
6161

62-
msg_info "Updating Playwright"
63-
$STD python3 -m pip install playwright --upgrade
64-
msg_ok "Updated Playwright"
65-
6662
msg_info "Updating Browserless (Patience)"
6763
systemctl stop browserless
64+
cp /opt/browserless/.env /opt/browserless.env
65+
rm -rf browserless
66+
brwsr_tmp=$(mktemp)
6867
TAG=$(curl -s https://api.github.com/repos/browserless/browserless/tags?per_page=1 | grep "name" | awk '{print substr($2, 3, length($2)-4) }')
69-
wget -q https://github.com/browserless/browserless/archive/refs/tags/v${TAG}.zip
70-
unzip -q v${TAG}.zip
71-
cp -r browserless-${TAG}/* /opt/browserless
68+
wget -q https://github.com/browserless/browserless/archive/refs/tags/v${TAG}.zip -O $brwsr_tmp
69+
unzip -q $brwsr_tmp
70+
mv browserless-${TAG}/ /opt/browserless
7271
cd /opt/browserless
73-
$STD npm update
74-
$STD node_modules/playwright-core/cli.js install --with-deps chromium firefox webkit
75-
$STD node_modules/playwright-core/cli.js install --force chrome msedge
72+
$STD npm install
73+
rm -rf src/routes/{chrome,edge,firefox,webkit}
74+
$STD node_modules/playwright-core/cli.js install --with-deps chromium
7675
$STD npm run build
7776
$STD npm run build:function
7877
$STD npm prune production
78+
mv /opt/browserless.env /opt/browserless/.env
7979
msg_ok "Updated Browserless"
8080

81-
msg_info "Starting services"
81+
msg_info "Restarting services"
8282
systemctl start minio Reactive-Resume browserless
83-
msg_ok "Started services"
83+
msg_ok "Restarted services"
8484

8585
msg_info "Cleaning Up"
8686
rm -f /tmp/minio.deb
87-
rm -f /tmp/v${RELEASE}.zip
88-
rm -f /tmp/v${TAG}.zip
89-
rm -rf /tmp/${APP}-${RELEASE}
90-
rm -rf /tmp/browserless-${TAG}
87+
rm -f $brwsr_tmp
88+
rm -f $res_tmp
9189
msg_ok "Cleanup Completed"
9290

9391
echo "${RELEASE}" >/opt/${APP}_version.txt

install/reactive-resume-install.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ $STD apt-get install -y \
2020
mc \
2121
gnupg \
2222
unzip \
23-
postgresql-common \
24-
python3-pip
25-
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
23+
postgresql-common
2624
msg_ok "Installed Dependencies"
2725

2826
msg_info "Installing Additional Dependencies"
@@ -58,24 +56,25 @@ unzip -q v${RELEASE}.zip
5856
mv ${APPLICATION}-${RELEASE}/ /opt/${APPLICATION}
5957
cd /opt/${APPLICATION}
6058
corepack enable
59+
export CI="true"
6160
export PUPPETEER_SKIP_DOWNLOAD="true"
61+
export NODE_ENV="production"
6262
export NEXT_TELEMETRY_DISABLED=1
63-
export CI="true"
6463
$STD pnpm install --frozen-lockfile
6564
$STD pnpm run build
65+
$STD pnpm install --prod --frozen-lockfile
6666
$STD pnpm run prisma:generate
6767
msg_ok "Installed ${APPLICATION}"
6868

6969
msg_info "Installing Browserless (Patience)"
7070
cd /tmp
71-
$STD python3 -m pip install playwright
7271
wget -q https://github.com/browserless/browserless/archive/refs/tags/v${TAG}.zip
7372
unzip -q v${TAG}.zip
7473
mv browserless-${TAG} /opt/browserless
7574
cd /opt/browserless
7675
$STD npm install
77-
$STD node_modules/playwright-core/cli.js install --with-deps chromium firefox webkit
78-
$STD node_modules/playwright-core/cli.js install --force chrome msedge
76+
rm -rf src/routes/{chrome,edge,firefox,webkit}
77+
$STD node_modules/playwright-core/cli.js install --with-deps chromium
7978
$STD npm run build
8079
$STD npm run build:function
8180
$STD npm prune production
@@ -187,6 +186,7 @@ customize
187186

188187
msg_info "Cleaning up"
189188
rm -f /tmp/v${RELEASE}.zip
189+
rm -f /tmp/v${TAG}.zip
190190
rm -f /tmp/minio.deb
191191
$STD apt-get -y autoremove
192192
$STD apt-get -y autoclean

0 commit comments

Comments
 (0)