Multibranch Pipeline git events on PR

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

Multibranch Pipeline git events on PR

Gautam, Rishi
I was trying to carry out git operations on any other branch than the PR source/destination branch in a jenkins multibranch pipeline.
When I scanned the branches inside the PR build job, I didn't see any other branches. I only got below branches on git branch -a command on pipeline:
* PR-2
  remotes/origin/PR-2
  remotes/upstream/stage

There are other branches like test,master. Are there any workarounds to this?

--
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/CAF4beLgO26Pw2fQOMvXLxTpop%2B9oDjqUsxkEALKsApE6zNfMRw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Multibranch Pipeline git events on PR

Gautam, Rishi
anyone has any idea please

On Wed, Feb 10, 2021 at 4:16 PM Gautam, Rishi <[hidden email]> wrote:
I was trying to carry out git operations on any other branch than the PR source/destination branch in a jenkins multibranch pipeline.
When I scanned the branches inside the PR build job, I didn't see any other branches. I only got below branches on git branch -a command on pipeline:
* PR-2
  remotes/origin/PR-2
  remotes/upstream/stage

There are other branches like test,master. Are there any workarounds to this?

--
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/CAF4beLjrC-Yqd%3DSDqHk-WJEUSnm9%3Dyi4D0srBmdks7SDojrjTA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Multibranch Pipeline git events on PR

Dirk Heinrichs-3
In reply to this post by Gautam, Rishi
Am Mittwoch, den 10.02.2021, 16:16 +0545 schrieb Gautam, Rishi:

I was trying to carry out git operations on any other branch than the PR source/destination branch in a jenkins multibranch pipeline.
When I scanned the branches inside the PR build job, I didn't see any other branches. I only got below branches on git branch -a command on pipeline:
* PR-2
  remotes/origin/PR-2
  remotes/upstream/stage

Any chance the job configuration contains a branch filter?

HTH...

Dirk
-- 
Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Phone: +49 2226 15966 18
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan, Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.

--
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/89957a72d652f2e56a2622a2da67756688afee42.camel%40opentext.com.

signature.asc (235 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Multibranch Pipeline git events on PR

kuisathaverat
In reply to this post by Gautam, Rishi
Check if you have set git references on the job, IIRC the git plugin always make a `git fetch —all`

El lunes, 15 de febrero de 2021 a las 10:49:21 UTC+1, Rishi Gautam escribió:
anyone has any idea please

On Wed, Feb 10, 2021 at 4:16 PM Gautam, Rishi <[hidden email]> wrote:
I was trying to carry out git operations on any other branch than the PR source/destination branch in a jenkins multibranch pipeline.
When I scanned the branches inside the PR build job, I didn't see any other branches. I only got below branches on git branch -a command on pipeline:
* PR-2
  remotes/origin/PR-2
  remotes/upstream/stage

There are other branches like test,master. Are there any workarounds to this?

--
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/691d1a51-5ae2-4004-8e56-7c3fa3f6a17an%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Multibranch Pipeline git events on PR

Mark Waite-2
The multibranch pipeline implementation on one or more of the branch providers intentionally narrows the refspec of the repository while cloning it into the workspace.  The narrowed refspec usually includes only a single branch so that git does not waste effort retrieving changes that are not related to the branch being built.  That narrow refspec 

If you need more branches available in the workspace, you may need to use a checkout scm step within your pipeline definition that specifically chooses to use the wider refspec that you need for the additional branches you're trying to access.

Refspecs are described in the "repostories" section of the git plugin documentation and in the command line git documentation.

Example checkout steps can be generated with the Pipeline Syntax snippet generator from your Jenkins controller.  A brief video clip on using the snippet generator is linked from the git plugin documentation.

Mark Waite

On Mon, Feb 15, 2021 at 12:57 PM Ivan Fernandez Calvo <[hidden email]> wrote:
Check if you have set git references on the job, IIRC the git plugin always make a `git fetch —all`

El lunes, 15 de febrero de 2021 a las 10:49:21 UTC+1, Rishi Gautam escribió:
anyone has any idea please

On Wed, Feb 10, 2021 at 4:16 PM Gautam, Rishi <[hidden email]> wrote:
I was trying to carry out git operations on any other branch than the PR source/destination branch in a jenkins multibranch pipeline.
When I scanned the branches inside the PR build job, I didn't see any other branches. I only got below branches on git branch -a command on pipeline:
* PR-2
  remotes/origin/PR-2
  remotes/upstream/stage

There are other branches like test,master. Are there any workarounds to this?

--
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/691d1a51-5ae2-4004-8e56-7c3fa3f6a17an%40googlegroups.com.

--
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/CAO49JtHHg-XkDiqiStxFfHjuf1ANAKAjLHGMLx75RvHr%3DyfARQ%40mail.gmail.com.