temp/deploy.sh

31 lines
860 B
Bash
Executable File

#! /bin/bash
SOURCE_DIR=/home/neuu/attendence_UI/frontend
BRANCH=master
FRONTEND_DIR=/var/www/exampaper.vidh.ai
SERVER_IP=52.66.73.43
cd ~/$SOURCE_DIR
echo "Changed into attendence UI frontend dir ....."
echo "Pulling $BRANCH ..."
git pull origin $BRANCH
if [[ $? -eq 0 ]];then
echo "Pulled the latest code ...."
npm run build
if [[ $? -eq 0 ]];then
echo "Build the latest file ....."
scp -r dist/* ubuntu@$SERVER_IP:$FRONTEND_DIR
if [[ $? -eq 0 ]];then
echo "Copying build file to $FRONTEND_DIR successfull ...."
else
echo "Copying build file to $FRONTEND_DIR failed ...."
fi
else
echo "Build file failed ...."
fi
else
echo "Pulling latest code failed ...."
fi