Skip to content

Instantly share code, notes, and snippets.

@mu88
Created March 1, 2018 16:34
Show Gist options
  • Save mu88/bb60ee30cc90c9761922c636bb4d252b to your computer and use it in GitHub Desktop.
Save mu88/bb60ee30cc90c9761922c636bb4d252b to your computer and use it in GitHub Desktop.
Git - Notify Jenkins (Post Commit Hook)
#!/bin/bash
echo Notifying Jenkins Server
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
echo "== $branch =="
curl -s "https://myJenkins.com/git/notifyCommit?url=https://myGitServer.com/MyGitRepository.git&branches=$branch"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment