Created
March 1, 2018 16:34
-
-
Save mu88/bb60ee30cc90c9761922c636bb4d252b to your computer and use it in GitHub Desktop.
Git - Notify Jenkins (Post Commit Hook)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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