Skip to content
Snippets Groups Projects
Commit 3aba9193 authored by Joris ten Tusscher's avatar Joris ten Tusscher
Browse files

Added default argument values to the deploy script so it can be executed on VM...

Added default argument values to the deploy script so it can be executed on VM boot to automatically start the latest release from the master branch.
parent 16e50c12
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
# $1: port number to run the server # $1: port number to run the server
# $2: filename to log output # $2: filename to log output
PORT="${1:-8080}"
LOG="${2:-out.log}"
# Get latest HEAD # Get latest HEAD
git pull origin master git pull origin master
# Build project # Build project
stack build stack build
# Kill previous process # Kill previous process
pkill javawlp pkill javawlp
# Backup previous log # Backup previous log if it exists by appending it to a backup file.
if [ -f $2 ] [[ -f $LOG ]] && cat $LOG >> "$LOG".backup
then # Run server
mv $2 "$2".backup nohup stack exec javawlp -- --runServer -p $PORT > $LOG &
fi
# Run server
nohup stack exec javawlp -- --runServer -p $1 > $2 &
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment