Skip to content

Instantly share code, notes, and snippets.

@daniel-fanjul-alcuten
Created October 10, 2012 10:48
Show Gist options
  • Save daniel-fanjul-alcuten/3864736 to your computer and use it in GitHub Desktop.
Save daniel-fanjul-alcuten/3864736 to your computer and use it in GitHub Desktop.
continuous deploying
#!/bin/bash -x
alpha=$1 && shift || { echo "which alpha?"; exit 1; }
run() {
echo && echo "-> $*"
eval "$*"
}
hg-pull-and-deploy() {
run hg update -C
(
set +x
run hg pull -u -b .
run hg parents
run 'echo `hostname`: `date`'
) | tee hg-pull.log.txt
(
set +x
ANT_ARGS="" run ant deploy-alpha -Dalpha.number=$alpha -Dthreads=9999
) | tee ant-deploy.log.txt
sendEmail -f [email protected] -t [email protected] -u "`hg parents --template 'autodeploy: {branch} ({node|short}) in '$alpha' [EOM]'`" -a ant-deploy.log.txt < hg-pull.log.txt
rm hg-pull.log.txt ant-deploy.log.txt
}
hg-pull-and-deploy
while true; do
while hg in -b .; do
hg-pull-and-deploy
done
sleep 59
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment