mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 02:48:38 -04:00
Installing global npm packages in one command.
This commit is contained in:
parent
a9560992c5
commit
7b71554ad7
3 changed files with 13 additions and 20 deletions
|
|
@ -1,10 +1,10 @@
|
|||
#! /usr/bin/env bash
|
||||
# This script will install WROLPi to `/opt/wrolpi` on a fresh/empty Raspberry Pi. It is expected to be run once to
|
||||
# This script will install WROLPi to `/opt/wrolpi` on a fresh/empty machine. It is expected to be run once to
|
||||
# install, and any subsequent runs will update WROLPi. This script assumes it will be run as the `root` user.
|
||||
|
||||
Help() {
|
||||
# Display Help
|
||||
echo "Install WROLPi onto this Raspberry Pi."
|
||||
echo "Install WROLPi onto this machine."
|
||||
echo
|
||||
echo "Syntax: install.sh [-h] [-b BRANCH]"
|
||||
echo "options:"
|
||||
|
|
|
|||
|
|
@ -10,27 +10,25 @@ apt install -y apt-transport-https ca-certificates curl gnupg-agent gcc libpq-de
|
|||
postgresql-13 nginx-full nginx-doc python3-full python3-dev python3-doc python3-venv htop vim ffmpeg hostapd \
|
||||
chromium chromium-driver cpufrequtils network-manager npm
|
||||
|
||||
# Install Archiving tools.
|
||||
SF_VERSION="1.0.15"
|
||||
if [ "$(single-file --version)" != "${SF_VERSION}" ]; then
|
||||
sudo npm i -g single-file-cli@1.0.15 & # Install in background.
|
||||
fi
|
||||
readability-extractor --version || npm install -g 'git+https://github.com/pirate/readability-extractor'
|
||||
# Install serve, and archiving tools.
|
||||
sudo npm i -g serve single-file-cli@1.0.15 'git+https://github.com/pirate/readability-extractor' &
|
||||
|
||||
# Setup the virtual environment that main.py expects
|
||||
pip3 --version || (
|
||||
# If no pip, install pip
|
||||
curl https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py &&
|
||||
python3 /tmp/get-pip.py
|
||||
python3 /tmp/get-pip.py &
|
||||
)
|
||||
|
||||
# Wait for npm and pip3.
|
||||
wait $(jobs -p)
|
||||
|
||||
# Build React app in background job.
|
||||
[[ ! -f /usr/local/bin/serve || ! -f /usr/bin/serve ]] && npm -g install serve
|
||||
cd /opt/wrolpi/app || exit 5
|
||||
npm install || npm install || npm install || npm install # try install multiple times :(
|
||||
npm run build &
|
||||
|
||||
# Install python requirements files in background job.
|
||||
# Install python requirements in background job.
|
||||
pip3 install -r /opt/wrolpi/requirements.txt &
|
||||
|
||||
wait $(jobs -p)
|
||||
|
|
|
|||
|
|
@ -13,12 +13,8 @@ apt install -y apt-transport-https ca-certificates curl gnupg-agent gcc libpq-de
|
|||
postgresql-12 nginx-full nginx-doc python3.8-minimal python3.8-dev python3.8-doc python3.8-venv \
|
||||
ffmpeg hostapd nodejs chromium-browser chromium-chromedriver cpufrequtils network-manager
|
||||
|
||||
# Install Archiving tools.
|
||||
SF_VERSION="1.0.15"
|
||||
if [ "$(single-file --version)" != "${SF_VERSION}" ]; then
|
||||
sudo npm i -g single-file-cli@${SF_VERSION} & # Install in background.
|
||||
fi
|
||||
readability-extractor --version || npm install -g 'git+https://github.com/pirate/readability-extractor' &
|
||||
# Install serve, and archiving tools.
|
||||
sudo npm i -g serve single-file-cli@1.0.15 'git+https://github.com/pirate/readability-extractor' &
|
||||
|
||||
# Setup the virtual environment that main.py expects
|
||||
pip3 --version || (
|
||||
|
|
@ -27,16 +23,15 @@ pip3 --version || (
|
|||
python3 /tmp/get-pip.py &
|
||||
)
|
||||
|
||||
# Wait for single-file, readability, pip3.
|
||||
# Wait for npm and pip3.
|
||||
wait $(jobs -p)
|
||||
|
||||
# Build React app in background job.
|
||||
[[ ! -f /usr/local/bin/serve || ! -f /usr/bin/serve ]] && npm -g install serve
|
||||
cd /opt/wrolpi/app || exit 5
|
||||
npm install || npm install || npm install || npm install # try install multiple times :(
|
||||
npm run build &
|
||||
|
||||
# Install python requirements files in background job.
|
||||
# Install python requirements in background job.
|
||||
pip3 install -r /opt/wrolpi/requirements.txt &
|
||||
|
||||
wait $(jobs -p)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue