infra/codestorage/hg-ssh
2015-10-14
Parent:121585c71fd7
infra/codestorage/hg-ssh/post-commit-broadcast.sh
Use the relative DNS address. Use the relative DNS address when digging for web frontends, which now works thanks to +search on dig. This allows us to transfer between namespaces without needing to change anything. Also makes this, in general, more flexible.
1 #!/bin/bash
3 cwd=`/bin/pwd`
4 me=`whoami`
5 stripped=${cwd#/home/$me/repos/}
7 if [ $stripped = $cwd ]
8 then
9 stripped=${cwd#/mounted/repos/}
10 fi
12 if [ $stripped = $cwd ]
13 then
14 echo "Can't get repo name from ${cwd} aborting"
15 exit 0
16 fi
18 FRONTENDS=$(dig mercurial-uwsgi-headless +short +search)
19 for fe in $FRONTENDS
20 do
21 hg push http://${fe}:8080/${stripped}
22 done
24 exit 0