Questions tagged [multibranch-pipeline]

Multibranch Pipeline is a Jenkins job configuration type provided by the Pipeline: Multibranch Plugin that detects and builds SCM branches.

Multibranch Pipeline is a Jenkins job configuration type provided by the Pipeline: Multibranch Plugin that detects and builds SCM branches.

310 questions
8
votes
2 answers

Grant copy artIfact permission in multi-branch pipeline

I have the following setup: A Jenkins multi-branch pipeline job configured through Jenkinsfile. After successful checkout and build, the artifact is archived and a downstream job is triggered to deploy the generated artifact. For the second job to…
TheRock3t
  • 628
  • 9
  • 22
7
votes
3 answers

Jenkins-Github/Git - "Error validating repository information. Credentials ok."

On Jenkins, While setting up Multibranch setup with "Github" on Jenkins, I get strange error as Error validating repository information. Credentials ok. However same credential works for "git" as "Add Source" category but fails for "github" if…
Krishna
  • 501
  • 1
  • 8
  • 17
7
votes
3 answers

Why would a job in Jenkins multibranch pipeline gets disabled

We are using Jenkins(v2.235.1) and BitBucket cloud combination. We have BitBucket Team/Project type job which has created multi-branch pipelines. Some of the jobs corresponding to individual branches are getting disabled even these branches in the…
Bhavya
  • 71
  • 1
  • 2
7
votes
8 answers

How to disable triggers from branch indexing but still allow SCM triggering in multibranch jobs

When using a Jenkins Multibranch Pipeline Job if you choose Suppress Automatic SCM trigger in the job it will stop the job from building after indexing branches (great functionality). However for some reason this ALSO will kill the ability to…
emmdee
  • 1,541
  • 3
  • 25
  • 46
7
votes
1 answer

Branch Indexing in jenkins multibranch pipeline triggers extra build, which is already built by poll SCM

I have a multibranch pipeline. I have configured Trigger in jenkinsFile properties: pipelineTriggers([pollSCM('H/2 * * * *')])]) The multibranch pipeline is configured to "scan Multibranch Pipeline Triggers" periodically. Expected behavior:…
7
votes
1 answer

Jenkins: how to specify jenkinsfile in multibranch project

Using Jenkins for multi-platform mutibranch builds. I have multiple Multibranch Pipeline projects (one for each platform, since each platform requires notably different build steps). I have one code repository with multiple branches (which is why…
Allen Pestaluky
  • 3,126
  • 2
  • 20
  • 22
7
votes
2 answers

Custom Project Recognisers for Jenkins Multi-branch Pipelines

When you create a Github Organisation or a Bitbucket Team/Project, one of the configuration items is: Project Recognizers: Pipeline Jenkinsfile There are no other options other than "Pipeline Jenkinsfile", however the fact that the option is even…
7
votes
3 answers

How to use jenkins environment variable in Jenkinsfile if statement

I am trying to use an if statement in my Jenkinsfile for multi branch pipeline project. For the sake of this question, assume I have a text file in my current directory called 'scan.txt'. The text file is generated with a bash command echo "False" >…
Dalton Sweeney
  • 1,108
  • 3
  • 11
  • 24
7
votes
3 answers

How to set next build number in Multibranch pipeline for a particular branch

I am trying to set the next build number for our release branch programmatically but I'm facing an issue. Below are the two ways I tried it: def job = Jenkins.instance.getItem("master") job.nextBuildNumber = env.BUILD_NUMBER +…
swati jain
  • 79
  • 1
  • 2
6
votes
0 answers

Jenkins Pipeline - wait for non-job items (ComputedFolder, Multibranch Pipeline Project)

I'm using multibranch pipeline projects in Jenkins. I let Jenkins index new branches. I need Jenkins to wait until the indexing of a multibranch pipeline project is complete. This is my current code: def triggerScanMultibranchPipeline(projectDir,…
Amedee Van Gasse
  • 7,280
  • 5
  • 55
  • 101
6
votes
3 answers

Branch disabled in multibranch pipeline and reopened with Scan event

We have one project configured as multibranch pipeline project with branch filtered master and development. After few hours the master branch is disabled with a strikethrough symbol across its name and build option not available . When clicked on…
Alim Azad
  • 471
  • 2
  • 9
  • 23
6
votes
2 answers

Jenkins Multi-branch: How do I add functionality to branch creation/deletion?

I am setting up a Jenkins multi-branch instance which needs to allocate a resource on branch job creation when a new branch is detected by the https://wiki.jenkins.io/display/JENKINS/Pipeline+Multibranch+Plugin plugin (version 2.21), and…
Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
6
votes
0 answers

How to get Jenkins lastBuild API working with multi-branch pipelines?

I've had no problems getting last build details out of Jenkins in the past, but I've struck a weirdly-configured corporate environment, where the API urls are structured like this: https://example.com/job/group-name/job/project-name/api/json I can…
Nello
  • 772
  • 7
  • 15
6
votes
1 answer

Jenkins declarative pipeline with different triggers per branch

I am looking to implement different cron triggers per branch in a declarative pipeline jenkins job. At the minute, I am only triggering hourly builds on our dev branch: String cron_string = BRANCH_NAME == "dev" ? "@hourly" : "" pipeline { …
6
votes
1 answer

Gitlab Merge request events not triggering Jenkins Multi-branch pipeline

I'm trying to trigger Jenkins Multi-branch pipeline job with GitLab Webhook on Merge request events. When I'm testing the Webhook, I'm getting this message: Hook executed successfully but returned HTTP 409 When I'm setting different GitLab…
Elad Eizner
  • 63
  • 1
  • 6
1 2
3
20 21