diff --git a/post-receive b/post-receive index 5ddbee2..8d5dcd2 100755 --- a/post-receive +++ b/post-receive @@ -24,3 +24,5 @@ export GIT_CONFIG tee >($BINDIR/post-receive-notify-updates 1>&2) \ | $BINDIR/post-receive-email 1>&2 + +$BINDIR/post-receive-notify-jenkins 1>&2 diff --git a/post-receive-notify-jenkins b/post-receive-notify-jenkins new file mode 100755 index 0000000..fef9dab --- /dev/null +++ b/post-receive-notify-jenkins @@ -0,0 +1,12 @@ +#!/bin/sh +# Adapted from https://gist.github.com/vchatela/1cbca8f126b8ea8032ecd34b84164702 +set -eu + +GITDIR=$(git rev-parse --absolute-git-dir) +BASENAME=$(basename ${GITDIR}) + +REPOSITORY_URL=git://repos.entrouvert.org/${BASENAME} +TRIGGER_URL=https://jenkins.entrouvert.org/git/notifyCommit?url=${REPOSITORY_URL} + +echo -n "Notifying Jenkins of changes to $REPOSITORY_URL..." +curl --max-time 5 --no-progress-meter "$TRIGGER_URL" || echo Failed to notify Jenkins