#!/bin/sh # This sets up the post-commit hooks to send mail and notify KGB, # for all d-i repos. It is designed to be run again when adding a new repo. set -e cd /git/d-i SAVE_UMASK=`umask` umask 007 cat > kgb-client.conf.new <> kgb-client.conf.new mv -f kgb-client.conf.new kgb-client.conf umask $SAVE_UMASK # Where the kgb-bot lives, until it's installed system-wide. KGB=/home/groups/kgb/trunk for repo in *.git attic/*.git; do cd /git/d-i/$repo proj=$(echo $repo | sed 's/\.git$//') # TODO search for [l10n] and SILENT_COMMIT in commit message; send # former to bubulle and drop latter. rm -f hooks/post-receive.new cat > hooks/post-receive.new <> hooks/post-receive.new case "$proj" in daily-build-logs|kadit|kadit-playbooks) : # shh ;; *) echo 'echo "Nudging jenkins.debian.net to see if any jobs are watching this repo:"' >> hooks/post-receive.new echo 'curl -s "https://jenkins.debian.net/git/notifyCommit?url=git://git.debian.org/git/d-i/$(basename $PWD .git)"' >> hooks/post-receive.new ;; esac echo "exec /usr/local/bin/git-commit-notice" >> hooks/post-receive.new chmod 755 hooks/post-receive.new mv -f hooks/post-receive.new hooks/post-receive cat > hooks/post-update.new < description done