git-bin/post-receive-notify-jenkins

13 lines
459 B
Bash
Executable File

#!/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