Last active
December 16, 2015 10:59
-
-
Save Tehnix/5423971 to your computer and use it in GitHub Desktop.
To deploy HsIRCb with jenkins. Clean/Configure/Install/Build with cabal-dev, and then start the program.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
cd $WORKSPACE | |
PID_FILENAME="$WORKSPACE/HsIRCb.pid" | |
LOG_FILENAME="$WORKSPACE/HsIRCb.log" | |
touch $PID_FILENAME # Make sure the pid file exists | |
PID=$(cat $PID_FILENAME) | |
if kill -0 $PID > /dev/null 2>&1; then | |
# The program is running | |
#kill $PID | |
daemon --name=HsIRCb --stop | |
/var/lib/jenkins/.cabal/bin/cabal-dev clean | |
#/var/lib/jenkins/.cabal/bin/cabal-dev configure | |
/var/lib/jenkins/.cabal/bin/cabal-dev install | |
/var/lib/jenkins/.cabal/bin/cabal-dev build | |
strip dist/build/HsIRCb/HsIRCb | |
#/usr/local/bin/daemonize -p $WORKSPACE/$PID_FILENAME $WORKSPACE/dist/build/HsIRCb/HsIRCb | |
daemon --name=HsIRCb --chdir=$WORKSPACE --command=$WORKSPACE/dist/build/HsIRCb/HsIRCb --pidfile=$PID_FILENAME | |
else | |
# The program ain't running | |
/var/lib/jenkins/.cabal/bin/cabal-dev clean | |
#/var/lib/jenkins/.cabal/bin/cabal-dev configure | |
/var/lib/jenkins/.cabal/bin/cabal-dev install | |
/var/lib/jenkins/.cabal/bin/cabal-dev build | |
strip dist/build/HsIRCb/HsIRCb | |
#/usr/local/bin/daemonize -p $WORKSPACE/$PID_FILENAME $WORKSPACE/dist/build/HsIRCb/HsIRCb | |
daemon --name=HsIRCb --chdir=$WORKSPACE --command=$WORKSPACE/dist/build/HsIRCb/HsIRCb --pidfile=$PID_FILENAME | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment