Our team has recently moved from a locally hosted Subversion repository to a private GitHub repository. In the past, when we had a build that we were ready to mark as 'released', we would use the 'Tag this build' sidebar link to add a SVN tag on the contents of the build.
With the move to GitHub, I have tagging of a build working in Jenkins, but it only seems to tag the build locally. The tag displays up if I run git tag
in the workspace directory, but it never gets pushed to GitHub.
Is there a way to have Jenkins push a tag to a remote repository whenever the build is tagged through Jenkins?
In the "Git Repository" section of your job, under the "Source Code Management" heading, click "Advanced". Under "Branches to build", "Branch specifier", put */tags/<TAG_TO_BUILD> (replacing <TAG_TO_BUILD> with your actual tag name).
Step 1: go to your GitHub repository and click on 'Settings'. Step 2: Click on Webhooks and then click on 'Add webhook'. Step 3: In the 'Payload URL' field, paste your Jenkins environment URL. At the end of this URL add /github-webhook/.
Select 'Push GIT tags back to origin repository' from the post-build actions (this is required to update your centralised git repo with the results of the build).
https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-AdvancedFeatures
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