Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
jenkinsjobname=<INSERT>
jenkinsbuildtoken=<INSERT>
jenkinsusername=<INSERT>
jenkinspasswordhash=<INSERT>
jenkinsurl=<INSERT>
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ "master" == "$branch" ]; then
echo "$(date) triggering jenkins build..."
curl -s -k "https://${jenkinsusername}:${jenkinspasswordhash}@${jenkinsurl}/job/${jenkinsjobname}/build?token=${jenkinsbuildtoken}&cause=triggered+by+gogs"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.