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.
This commit is contained in:
parent
4fee8856a2
commit
6e7cc765c2
@ -37,15 +37,14 @@ function update_script() {
|
|||||||
|
|
||||||
msg_info "Updating $APP to v${RELEASE}"
|
msg_info "Updating $APP to v${RELEASE}"
|
||||||
cp /opt/${APP}/.env /opt/rxresume.env
|
cp /opt/${APP}/.env /opt/rxresume.env
|
||||||
cd /tmp
|
res_tmp=$(mktemp)
|
||||||
wget -q "https://github.com/AmruthPillai/Reactive-Resume/archive/refs/tags/v${RELEASE}.zip"
|
rm -rf /opt/${APP}
|
||||||
unzip -q v${RELEASE}.zip
|
wget -q "https://github.com/AmruthPillai/Reactive-Resume/archive/refs/tags/v${RELEASE}.zip" -O $res_tmp
|
||||||
cp -r ${APP}-${RELEASE}/* /opt/${APP}
|
unzip -q $res_tmp
|
||||||
|
mv ${APP}-${RELEASE}/ /opt/${APP}
|
||||||
cd /opt/${APP}
|
cd /opt/${APP}
|
||||||
corepack enable
|
|
||||||
export PUPPETEER_SKIP_DOWNLOAD="true"
|
export PUPPETEER_SKIP_DOWNLOAD="true"
|
||||||
export NEXT_TELEMETRY_DISABLED=1
|
export NEXT_TELEMETRY_DISABLED=1
|
||||||
export CI="true"
|
|
||||||
$STD pnpm install --frozen-lockfile
|
$STD pnpm install --frozen-lockfile
|
||||||
$STD pnpm run build
|
$STD pnpm run build
|
||||||
$STD pnpm run prisma:generate
|
$STD pnpm run prisma:generate
|
||||||
@ -59,35 +58,33 @@ function update_script() {
|
|||||||
$STD dpkg -i minio.deb
|
$STD dpkg -i minio.deb
|
||||||
msg_ok "Updated Minio"
|
msg_ok "Updated Minio"
|
||||||
|
|
||||||
msg_info "Updating Playwright"
|
|
||||||
$STD python3 -m pip install playwright --upgrade
|
|
||||||
msg_ok "Updated Playwright"
|
|
||||||
|
|
||||||
msg_info "Updating Browserless (Patience)"
|
msg_info "Updating Browserless (Patience)"
|
||||||
systemctl stop browserless
|
systemctl stop browserless
|
||||||
|
cp /opt/browserless/.env /opt/browserless.env
|
||||||
|
rm -rf browserless
|
||||||
|
brwsr_tmp=$(mktemp)
|
||||||
TAG=$(curl -s https://api.github.com/repos/browserless/browserless/tags?per_page=1 | grep "name" | awk '{print substr($2, 3, length($2)-4) }')
|
TAG=$(curl -s https://api.github.com/repos/browserless/browserless/tags?per_page=1 | grep "name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
wget -q https://github.com/browserless/browserless/archive/refs/tags/v${TAG}.zip
|
wget -q https://github.com/browserless/browserless/archive/refs/tags/v${TAG}.zip -O $brwsr_tmp
|
||||||
unzip -q v${TAG}.zip
|
unzip -q $brwsr_tmp
|
||||||
cp -r browserless-${TAG}/* /opt/browserless
|
mv browserless-${TAG}/ /opt/browserless
|
||||||
cd /opt/browserless
|
cd /opt/browserless
|
||||||
$STD npm update
|
$STD npm install
|
||||||
$STD node_modules/playwright-core/cli.js install --with-deps chromium firefox webkit
|
rm -rf src/routes/{chrome,edge,firefox,webkit}
|
||||||
$STD node_modules/playwright-core/cli.js install --force chrome msedge
|
$STD node_modules/playwright-core/cli.js install --with-deps chromium
|
||||||
$STD npm run build
|
$STD npm run build
|
||||||
$STD npm run build:function
|
$STD npm run build:function
|
||||||
$STD npm prune production
|
$STD npm prune production
|
||||||
|
mv /opt/browserless.env /opt/browserless/.env
|
||||||
msg_ok "Updated Browserless"
|
msg_ok "Updated Browserless"
|
||||||
|
|
||||||
msg_info "Starting services"
|
msg_info "Restarting services"
|
||||||
systemctl start minio Reactive-Resume browserless
|
systemctl start minio Reactive-Resume browserless
|
||||||
msg_ok "Started services"
|
msg_ok "Restarted services"
|
||||||
|
|
||||||
msg_info "Cleaning Up"
|
msg_info "Cleaning Up"
|
||||||
rm -f /tmp/minio.deb
|
rm -f /tmp/minio.deb
|
||||||
rm -f /tmp/v${RELEASE}.zip
|
rm -f $brwsr_tmp
|
||||||
rm -f /tmp/v${TAG}.zip
|
rm -f $res_tmp
|
||||||
rm -rf /tmp/${APP}-${RELEASE}
|
|
||||||
rm -rf /tmp/browserless-${TAG}
|
|
||||||
msg_ok "Cleanup Completed"
|
msg_ok "Cleanup Completed"
|
||||||
|
|
||||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||||
|
@ -21,8 +21,6 @@ $STD apt-get install -y \
|
|||||||
gnupg \
|
gnupg \
|
||||||
unzip \
|
unzip \
|
||||||
postgresql-common \
|
postgresql-common \
|
||||||
python3-pip
|
|
||||||
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
|
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Installing Additional Dependencies"
|
msg_info "Installing Additional Dependencies"
|
||||||
@ -58,24 +56,25 @@ unzip -q v${RELEASE}.zip
|
|||||||
mv ${APPLICATION}-${RELEASE}/ /opt/${APPLICATION}
|
mv ${APPLICATION}-${RELEASE}/ /opt/${APPLICATION}
|
||||||
cd /opt/${APPLICATION}
|
cd /opt/${APPLICATION}
|
||||||
corepack enable
|
corepack enable
|
||||||
export PUPPETEER_SKIP_DOWNLOAD="true"
|
|
||||||
export NEXT_TELEMETRY_DISABLED=1
|
|
||||||
export CI="true"
|
export CI="true"
|
||||||
|
export PUPPETEER_SKIP_DOWNLOAD="true"
|
||||||
|
export NODE_ENV="production"
|
||||||
|
export NEXT_TELEMETRY_DISABLED=1
|
||||||
$STD pnpm install --frozen-lockfile
|
$STD pnpm install --frozen-lockfile
|
||||||
$STD pnpm run build
|
$STD pnpm run build
|
||||||
|
$STD pnpm install --prod --frozen-lockfile
|
||||||
$STD pnpm run prisma:generate
|
$STD pnpm run prisma:generate
|
||||||
msg_ok "Installed ${APPLICATION}"
|
msg_ok "Installed ${APPLICATION}"
|
||||||
|
|
||||||
msg_info "Installing Browserless (Patience)"
|
msg_info "Installing Browserless (Patience)"
|
||||||
cd /tmp
|
cd /tmp
|
||||||
$STD python3 -m pip install playwright
|
|
||||||
wget -q https://github.com/browserless/browserless/archive/refs/tags/v${TAG}.zip
|
wget -q https://github.com/browserless/browserless/archive/refs/tags/v${TAG}.zip
|
||||||
unzip -q v${TAG}.zip
|
unzip -q v${TAG}.zip
|
||||||
mv browserless-${TAG} /opt/browserless
|
mv browserless-${TAG} /opt/browserless
|
||||||
cd /opt/browserless
|
cd /opt/browserless
|
||||||
$STD npm install
|
$STD npm install
|
||||||
$STD node_modules/playwright-core/cli.js install --with-deps chromium firefox webkit
|
rm -rf src/routes/{chrome,edge,firefox,webkit}
|
||||||
$STD node_modules/playwright-core/cli.js install --force chrome msedge
|
$STD node_modules/playwright-core/cli.js install --with-deps chromium
|
||||||
$STD npm run build
|
$STD npm run build
|
||||||
$STD npm run build:function
|
$STD npm run build:function
|
||||||
$STD npm prune production
|
$STD npm prune production
|
||||||
|
Loading…
x
Reference in New Issue
Block a user