infra/codestorage/hg-ssh
2015-10-14
Parent:bc0c83d5015d
infra/codestorage/hg-ssh/post-commit-broadcast.sh
Set trust settings to avoid annoying message. Update the hgrc to trust the .hgrc files of everyone in the committers group, because I got tired of seeing the "not trusting file /mounted/repos/blah-blah/.hg/hgrc from untrusted user root, group committers" message every time I pushed.
| paddy@2 | 1 #!/bin/bash |
| paddy@2 | 2 |
| paddy@2 | 3 cwd=`/bin/pwd` |
| paddy@2 | 4 me=`whoami` |
| paddy@2 | 5 stripped=${cwd#/home/$me/repos/} |
| paddy@2 | 6 |
| paddy@2 | 7 if [ $stripped = $cwd ] |
| paddy@2 | 8 then |
| paddy@2 | 9 stripped=${cwd#/mounted/repos/} |
| paddy@2 | 10 fi |
| paddy@2 | 11 |
| paddy@2 | 12 if [ $stripped = $cwd ] |
| paddy@2 | 13 then |
| paddy@2 | 14 echo "Can't get repo name from ${cwd} aborting" |
| paddy@2 | 15 exit 0 |
| paddy@2 | 16 fi |
| paddy@2 | 17 |
| paddy@3 | 18 FRONTENDS=$(dig mercurial-uwsgi-headless +short +search) |
| paddy@2 | 19 for fe in $FRONTENDS |
| paddy@2 | 20 do |
| paddy@2 | 21 hg push http://${fe}:8080/${stripped} |
| paddy@2 | 22 done |
| paddy@2 | 23 |
| paddy@2 | 24 exit 0 |