mytube-frontend/bin/script/update
2025-10-31 17:09:38 +01:00

29 lines
695 B
Bash
Executable File

#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
PROJECT_DIR=$(realpath $SCRIPT_DIR/../../)
ENV_DIR=$(realpath $PROJECT_DIR/../../../)
CWD=$(pwd)
source $ENV_DIR/bin/messages
source $ENV_DIR/bin/drun
# Pull branch in project directory
infomsg "[frontend]: Git pull"
cd "$PROJECT_DIR"
git pull
successmsg "[frontend]: Git pull done"
# Install node Packages
infomsg "[frontend]: NPM install"
drun frontend npm install
successmsg "[frontend]: NPM install done"
# Initial build of website
infomsg "[frontend]: NPM run build"
drun frontend npm run build
successmsg "[frontend]: NPM run build done"
# Switch back to current working directory
cd "$CWD"