1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00
VILLASweb/deploy.sh

55 lines
946 B
Bash
Raw Permalink Normal View History

2015-10-15 16:18:59 -04:00
#! /bin/sh
######################################
# Description
######################################
# Program:
# Pulls latest state from git repository
# and deploys them to the webserver.
#
# Arguments:
# -b - Branch name for git
# -r - Remote name for git
# -d - Path to destination where code is
# deployed into
#
######################################
# default arguments
remoteName=origin
branchName=master
deployPath=/var/www/html/
# read arguments
usage() {
echo "Usage: $0 [-b <branch_name>] [-r <remote_name>] [-p /path/to/destination]" 1>&2
exit 1
}
while getopts ":b:r:d:" o
do
case "${o}" in
b)
branchName=${OPTARG}
;;
r)
remoteName=${OPTARG}
;;
d)
deployPath=${OPTARG}
;;
*)
usage
;;
esac
done
# pull changes from git
git pull $remoteName $branchName
# build webapp
ember build -prod
# deploy website
cp -ar dist/* /var/www/html/mashup