HI ,All,
i followed with
page https://wiki.jenkins.io/display/JENKINS/GitHub+Branch+Source+Plugin to
enable tag will trigger a new build then the questions comes
How can I use "when" in declarative pipeline to do something like
deployment when a new tag is pushed to remote repository
stage('Example Deploy') {
when {
branch 'production' // here how we can use tag as condition
}
steps {
echo 'Deploying'
}
}
"
- When used with the Branch API Plugin
<https://wiki.jenkins.io/display/JENKINS/Branch+API+Plugin>, tags will
show up as a new category. The default configuration of Branch API will not
trigger builds for tags automatically.
This is by design, as one of the use-cases for tag discovery is to use
the tag job to perform deployment. If tags were built automatically, given
that the order in which the tag jobs actually execute is undefined, the
automatic build could cause significant issues. Branch API does provide a
mechanism to control what gets built automatically (known as the
BranchBuildStrategy) but that cannot be configured until you have at
least one extension plugin that provides a BranchBuildStrategy.
If you want tags to build automatically, you will need an extension
plugin for Branch API that implements at least one BranchBuildStrategy,
see AngryBytes/jenkins-build-everything-strategy-plugin
<https://github.com/AngryBytes/jenkins-build-everything-strategy-plugin> for
a prototype example of such an extension plugin.
“
Thanks
Lynn
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/7f91e19e-1e8f-45a4-8a36-d5d620867979%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.