Skip to content

Instantly share code, notes, and snippets.

@cosmo0920
Last active August 29, 2015 14:01
Show Gist options
  • Save cosmo0920/f8d8591a3d705babf135 to your computer and use it in GitHub Desktop.
Save cosmo0920/f8d8591a3d705babf135 to your computer and use it in GitHub Desktop.
Jenkins build script
export TWITTER_USER=piyo
export CABAL_COMMAND="cabal install yesod yesod-bin"
export DATE="`date +\"%Y/%m/%d %H:%M:%S\"`"
echo "=== \"${CABAL_COMMAND}\" scheduled. at ${DATE} ===" | tw --user=${TWITTER_USER} --pipe
# check versions
uname -mprsv
ghc --version
cabal --version
# clean work dir cabal environment
if [ -d .cabal-sandbox ]; then
rm -rf ./.cabal-sandbox
fi
if [ -f cabal.sandbox.config ]; then
rm cabal.sandbox.config
fi
# install vanilla yesod
cabal update
cabal sandbox init
cabal install alex happy
cabal install yesod yesod-bin
if [ $? == 0 ]; then
echo "\"${CABAL_COMMAND}\"\nsuccess! at ${DATE}" | tw --user=${TWITTER_USER} --pipe
else
echo "\"${CABAL_COMMAND}\"\nfailure! at ${DATE}" | tw --user=${TWITTER_USER} --pipe
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment