Are you using scripted or declarative pipelines to do this? I highly
suggest using the declarative format. What Git source control provider are
you using? If you're using GitHub, ensure that you're using the GitHub
Branch Source plugin too as it will automatically do the checkouts for you
and find the proper refspecs for branches and PR's.
On Tuesday, September 19, 2017 at 5:37:01 AM UTC-4, Kai Mildner wrote:
>
>
> Hi,
>
>
> i have a Jenkinsfile in my repository. On Jenkins i setted up a
> Multibranch Pipeline Project for the repository.
>
> Everything is fine, it builds via Jenkinsfile for everey branch i create
> and triggers also on push etc.
>
> Now i want to also build at pull requests. So the pull request is
> triggering the build.
>
> The Problem is now that my checkout is not working for the pull request.
>
>
> $class: 'GitSCM', branches: [[name: '${BRANCH_NAME}']],
> doGenerateSubmoduleConfigurations: false, extensions: [ [ $class:
> 'CloneOption', depth: 0, noTags: false, reference: '', shallow: true ], [
> $class: 'SubmoduleOption', disableSubmodules: false, parentCredentials:
> false, recursiveSubmodules: true, reference: '', trackingSubmodules: false ],
> [ $class: 'CleanBeforeCheckout' ] ], submoduleCfg: [], userRemoteConfigs: [ [
> credentialsId: 'xxxxxxxxxxxxxxxxxxxxxxx', url: 'my.git' ] ]
>
> So now i have the problem that the branch name is "PR-[number]" when i
> create a pull request. So checking out that branch is not possible, because
> it not exists. I also tried it with
>
>
> branches: [[name: '**']]
>
>
> But then nothing builds.
>
> The git server is a local Bitbucket server.
>
>
> What can i do to get also pullrequests Building?
>
>
> Regards
>
>
> Kai
>
--
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/4789e5d9-5504-43eb-ae30-27f0349b8bff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.