Our team is transitioning from CVS to Git. We intend to use the similar workflow as most open source projects on GitHub - each developer takes a fork of the main repo and then submits a pull request which will allow the project master to do a code review before merging the changes into the main repo.
Jenkins allows us to add multiple Git repositories (the standard Git plugin, not the Multiple SCM one). Presumably I can enter the URL for each forked repo and then Jenkins will check all branches each fork for changes. I give each repository a name eg "master", "developer1", "developer2"...
We want to have Jenkins tagging each build on the appropriate remote/fork. The Git Publisher plugin requires that you provide the "target remote name", but we need Jenkins to be able to figure this out for itself.
This process is just like sharing remote branches — you can run git push origin <tagname> . If you have a lot of tags that you want to push up at once, you can also use the --tags option to the git push command. This will transfer all of your tags to the remote server that are not already there.
By default, git push will not push tags. Tags have to be explicitly passed to git push . To push multiple tags simultaneously pass the --tags option to git push command.
The git plugin provides fundamental git operations for Jenkins projects. It can poll, fetch, checkout, branch, list, merge, tag, and push repositories.
I've managed to solve this one myself.
We're using GitLab and under the project Settings menu I add a "Web Hook":
http://my-jenkins-server.com/job/my-project/buildWithParameters?token=secret&remote=master
Add a web hook for each fork, and make sure that the "remote" parameter matches the repository name configured in Jenkins.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With