Skip to content

Instantly share code, notes, and snippets.

@lfreneda
Created November 5, 2012 13:41
Show Gist options
  • Save lfreneda/4017240 to your computer and use it in GitHub Desktop.
Save lfreneda/4017240 to your computer and use it in GitHub Desktop.
post hook hudson git
#!/bin/sh
#
# An example hook script for the "post-receive" event.
#
# The "post-receive" script is run after receive-pack has accepted a pack
# and the repository has been updated. It is passed arguments in through
# stdin in the form
# <oldrev> <newrev> <refname>
# For example:
# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
#
# see contrib/hooks/ for a sample, or uncomment the next line and
# rename the file to "post-receive".
#. /usr/share/doc/git-core/contrib/hooks/post-receive-email
read oldrev newrev refname
case $refname in
"refs/heads/homolog_levelupaccount")
echo 'Executando deploy [LevelUpAccount] para homologacao';
URL0='http://10.30.0.51:8081/job/homologacao.levelupgames.levelupaccount/build?delay=0sec';
;;
"refs/heads/desenv_allodsauth")
echo 'Executando deploy [Auth Allods] para desenvolvimento';
URL0='http://10.30.0.51:8081/job/desenvolvimento.levelupgames.allods/build?delay=0sec';
;;
"refs/heads/homolog_allodsauth")
echo 'Executando deploy [Auth Allods] para homologacao';
URL0='http://10.30.0.51:8081/job/homologacao.levelupgames.allods/build?delay=0sec';
;;
"refs/heads/homolog")
echo 'Executando deploy [Todo SVN clone] para homologacao';
#URL0='http://10.30.0.51:8081/job/homologacao.levelupgames.multivendas/build?delay=0sec';
#URL1='http://10.30.0.51:8081/job/homologacao.levelupgames.levelupaccount/build?delay=0sec';
#URL2='http://10.30.0.51:8081/job/homologacao.levelupgames.levelupadm/build?delay=0sec';
#URL2='http://10.30.0.51:8081/job/homologacao.levelupgames.gatewayframework/build?delay=0sec';
#URL3='http://10.30.0.51:8081/job/homologacao.levelupgames.b2b/build?delay=0sec';
#URL4='http://10.30.0.51:8081/job/homologacao.levelupgames.ccs/build?delay=0sec';
#URL5='http://10.30.0.51:8081/job/homologacao.levelupgames.forum/build?delay=0sec';
#URL6='http://10.30.0.51:8081/job/homologacao.levelupgames.billingjob/build?delay=0sec';
;;
esac
i=0;
while :
do
eval URL=\$URL$i;
if [ -z "$URL" ]; then
break
fi
echo "Run Hudson build at $URL"
/c/git/bin/wget.exe $URL
echo "Deleting wget file [index.html]"
rm index.htm*
i=`expr $i + 1`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment