mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-30 00:00:13 +01:00
Add deploy.sh
This commit is contained in:
parent
e9c8459216
commit
92d3d8a883
1 changed files with 54 additions and 0 deletions
54
deploy.sh
Executable file
54
deploy.sh
Executable file
|
@ -0,0 +1,54 @@
|
|||
#! /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
|
||||
|
Loading…
Add table
Reference in a new issue