Init deploy script for seasoned

This commit is contained in:
2019-08-01 13:32:14 +02:00
parent 6a8b4273ac
commit b91f3f6e82

36
deploy.sh Normal file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
PROJECT_DIR=/home/kevin/seasoned
# DEPLOY_DIR=/var/lib/seasoned/
cd $PROJECT_DIR
echo "Stashing local changes"
git add .
git stash
echo "Pulling from master"
git checkout master
git pull origin master
echo "Pull from master succeeded"
echo "Installing necessary dependencies"
yarn
echo "Building application"
sudo yarn build
echo "Copy build files to webserver folder"
if [ ! -z "$DEPLOY_DIR" ]
then
printf 'Copying files to %s\n' "$DEPLOY_DIR"
sudo cp -R dist $DEPLOY_DIR
cd $DEPLOY_DIR
fi
# echo "Setting permissions of dist folder to user 'ubuntu'"
# sudo chown -R ubuntu:ubuntu dist
echo "Restarting webserver"
sudo service request restart