(web.ui.sh): use npm for installation of webui

This commit is contained in:
Christoph Stenglein 2023-11-14 17:49:41 +01:00 committed by Christoph Stenglein
parent b402ee4c5f
commit 4523db7036

View file

@ -150,17 +150,12 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo "# Compile WebUI" echo "# Compile WebUI"
/home/admin/config.scripts/bonus.nodejs.sh on /home/admin/config.scripts/bonus.nodejs.sh on
if ! npm install --global yarn; then if ! npm install; then
echo "error='install yarn failed'" echo "error='npm install failed'"
exit 1 exit 1
fi fi
yarn config set --home enableTelemetry 0 if ! npm run build; then
if ! yarn install; then echo "error='npm run build failed'"
echo "error='yarn install failed'"
exit 1
fi
if ! yarn build; then
echo "error='yarn build failed'"
exit 1 exit 1
fi fi
@ -191,8 +186,8 @@ if [ "$1" = "update" ]; then
git reset --hard origin/${currentBranch} git reset --hard origin/${currentBranch}
newCommit=$(git rev-parse HEAD) newCommit=$(git rev-parse HEAD)
if [ "${oldCommit}" != "${newCommit}" ]; then if [ "${oldCommit}" != "${newCommit}" ]; then
yarn install npm install
yarn build npm run build
sudo rm -r /var/www/public/* 2>/dev/null sudo rm -r /var/www/public/* 2>/dev/null
sudo cp -r /home/blitzapi/blitz_web/build/* /var/www/public sudo cp -r /home/blitzapi/blitz_web/build/* /var/www/public
sudo chown www-data:www-data -R /var/www/public sudo chown www-data:www-data -R /var/www/public