Can multibranch pipeline support user-selected branch?

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

Can multibranch pipeline support user-selected branch?

Guy Knights
I've been looking into multibranch pipeline and I'm wondering, can it be configured to support build parameters to specify which branches will be built?

I know the branch config can be setup with a regex to specify that certain branches will be built, but it means that the same branches will be built every time. I want whoever kicks off the job to be able to specify that only particular branches will build at different times.

Thanks,
Guy

--
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/CANNH9msUkO1_Z3dF22%3D28qwToq%2BzfiNqcoe5ShHHfbVzN38G1A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can multibranch pipeline support user-selected branch?

David Karr

On Tue, Jun 11, 2019 at 1:47 PM Guy Knights <[hidden email]> wrote:
I've been looking into multibranch pipeline and I'm wondering, can it be configured to support build parameters to specify which branches will be built?

I know the branch config can be setup with a regex to specify that certain branches will be built, but it means that the same branches will be built every time. I want whoever kicks off the job to be able to specify that only particular branches will build at different times.

I'm not sure if this is what you're looking for, but a multibranch pipeline can be specifically fired for a particular branch, with a url like this:

    http://host:port/jenkins/job/<folder>/job/<folder>/job/${PULL_REQUEST_TO_BRANCH}/buildWithParameters?...


Thanks,
Guy

--
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/CANNH9msUkO1_Z3dF22%3D28qwToq%2BzfiNqcoe5ShHHfbVzN38G1A%40mail.gmail.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/CAA5t8VrKE9u-6WbRQGG13ijBmv3KA%3D-uMbWOHNrT9LcLe91O2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can multibranch pipeline support user-selected branch?

Ivan Fernandez Calvo
I do not get your point, Multibranch pipeline creates a new job for each branch that match with the criteria you specify, so you have a job for every branch, I do not understand what do you mean with ’ I want whoever kicks off the job to be able to specify that only particular branches will build at different time’ maybe you can do do it with the ’when’ directive https://jenkins.io/doc/book/pipeline/syntax/#when

--
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/1ae42c9f-7845-4511-8cf5-d554b66cdcb5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can multibranch pipeline support user-selected branch?

David Karr

On Wed, Jun 12, 2019 at 12:15 PM Ivan Fernandez Calvo <[hidden email]> wrote:
I do not get your point, Multibranch pipeline creates a new job for each branch that match with the criteria you specify, so you have a job for every branch, I do not understand what do you mean with ’ I want whoever kicks off the job to be able to specify that only particular branches will build at different time’ maybe you can do do it with the ’when’ directive https://jenkins.io/doc/book/pipeline/syntax/#when

In the situation where we use this syntax, the job is not spawned from within a pipeline job, it's spawned from an external trigger in BitBucket.


--
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/1ae42c9f-7845-4511-8cf5-d554b66cdcb5%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/CAA5t8Vq4qETk0WDXSwXvou4GYUPk%2Bv4BcY1rikoTLtOOjXsAQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can multibranch pipeline support user-selected branch?

Ivan Fernandez Calvo
In reply to this post by Ivan Fernandez Calvo
Also, remember that every branch has his own Jenkins file so you can do what ever you want on every branch in that file it would effect only that branch.

Finally, if your problem is the logic that you use to trigger scheduled build I would suggest to use a regular pipeline job to make the logic and the build step to trigger the job that you want

--
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/a1332811-2744-405d-837d-65841de56d24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.