Skip to content
Snippets Groups Projects
deploy.sh 494 B
Newer Older
#!/bin/bash
# $1: port number to run the server
# $2: filename to log output

LOGPATH="$(pwd)/$LOG"
BACKUPPATH="$(pwd)/$LOG".backup
# Get latest HEAD
git pull origin master
# Build project
stack build
# Kill previous process
pkill javawlp
# Backup previous log if it exists by appending it to a backup file.
Joris ten Tusscher's avatar
Joris ten Tusscher committed
if [ -f "$LOGPATH" ]
then
	cat "$LOGPATH" >> "$BACKUPPATH"
	rm "$LOGPATH"
fi
nohup stack exec javawlp -- --runServer -p $PORT > $LOG &