Jenkins Ignore Committer Strategy Plugin and job DSL

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Jenkins Ignore Committer Strategy Plugin and job DSL

NeilF
HI All

The 'Jenkins Ignore Committer Strategy Plugin ' does what I need with a multibranch pipeline but I can't find a way to configure it via the job DSL builder that works for me.

Has anyone got some example DSL ? I can't stick the config in the branchSources block. there's another way , to use branchSource { 

multibranchPipelineJob(buildName) {
description(
"on GitHub: <a href=\"${gitHubUrl}\">${gitHubUrl}</a>")
triggers {
periodic(
5) // scan sources every 5mins, as a fallback - unit is minutes
// the github webhook should trigger Jenkins
}

branchSources {
git {
remote(
<url>)
includes(
'<branches>')
credentialsId(<
id>)
}
}

Or this way is possible but I can't figure out how to specify includes to choose branch patterns I am interested in! 

branchSources {

branchSource {
source {
git {
remote(<repo>)
// can't specify
includes('<branches>')
credentialsId(<id>)
}
}

buildStrategies {
ignoreCommitterStrategy {
ignoredAuthors(
"[hidden email])
allowBuildIfNotExcludedAuthor(
true)
}
}
}
}

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a0322509-3f91-4633-91cf-5d61cfad25e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins Ignore Committer Strategy Plugin and job DSL

Victor Martinez
You might need to refer to the trais sections in the branchSource

- <YOUR_JENKINS_URL>/plugin/job-dsl/api-viewer/index.html#path/multibranchPipelineJob-branchSources-branchSource-source-git-traits-headWildcardFilter

multibranchPipelineJob(buildName) {
    ...

    branchSources {
    branchSource {
          source {
            git {
              remote(<url>)
              traits {
         headWildcardFilter {
                    includes('master* branch1')
                    excludes('')
                 }
              }
            }
          }
          buildStrategies {
              ignoreCommitterStrategy {
                  ignoredAuthors("[hidden email]")
                  allowBuildIfNotExcludedAuthor(true)
              }
          }
        }
    }
}


Cheers

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b17f6482-6a7e-4d16-b697-9f0f7cd085cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins Ignore Committer Strategy Plugin and job DSL

NeilF
Thanks Victor! I will try this out. 
Cheers,

Neil


On Wed, 21 Nov 2018 at 19:23, Victor Martinez <[hidden email]> wrote:
You might need to refer to the trais sections in the branchSource

- <YOUR_JENKINS_URL>/plugin/job-dsl/api-viewer/index.html#path/multibranchPipelineJob-branchSources-branchSource-source-git-traits-headWildcardFilter

multibranchPipelineJob(buildName) {
    ...

    branchSources {
    branchSource {
          source {
            git {
              remote(<url>)
              traits {
         headWildcardFilter {
                    includes('master* branch1')
                    excludes('')
                 }
              }
            }
          }
          buildStrategies {
              ignoreCommitterStrategy {
                  ignoredAuthors("[hidden email]")
                  allowBuildIfNotExcludedAuthor(true)
              }
          }
        }
    }
}


Cheers

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/ZjBFRPAbilE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b17f6482-6a7e-4d16-b697-9f0f7cd085cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CA%2BcvzQsNMUW_iok2ELOteHPOLm7tLE7Nm%2B8j6nT2GX4HTnKrOQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.