Questions tagged [jenkins-pipeline]

For questions specifically about Jenkins 2.0's pipeline architecture. This includes both declarative and scripted pipelines.

264 questions
20
votes
3 answers

How to disable some branches in Multibranch Jenkins Builds?

I have a multibranch job set to run any branch with a Jenkinsfile. I have some options I can think of if I want to remove a branch from the list of jobs running for the multi-branch pipeline. I can delete the branch I can delete the Jenkinsfile in…
David West
  • 1,463
  • 3
  • 16
  • 25
8
votes
2 answers

Jenkins Pipeline - input only if branch matches

I want to ask for input but only if we are on a certain branch. But the input is run before the when. Can this be done with declarative syntax? For example this will always prompt even when the branch is not master stage('only on master') { when…
Dave
  • 183
  • 1
  • 1
  • 4
6
votes
2 answers

Is it possible to use a JenkinsFile in one repo to build and deploy a related repo?

Our team has two separate repositories for a frontend/backend system. They would like to have these two repositories deployed to the shared team environment together. My understanding of the JenkinsFile is that it will only work on the repository…
avi
  • 1,279
  • 1
  • 13
  • 32
5
votes
3 answers

Determine the URL for a SCM trigger from inside the build

My Jenkins is affected by a known Jenkins bug where it will trigger jobs that have an SCM poll set if a change to the shared library happens. I can't have this, so I thought I would get the trigger info from inside the job and if the URL was from…
Levi
  • 1,044
  • 6
  • 18
4
votes
1 answer

Jenkins pipeline nested parallel

Jenkins pipeline, declarative. Simple question, how do I create a parallel stages inside a stage which is parallel by itself? pipeline { agent { label 'master' } options { timestamps() timeout(time: 15, unit: 'MINUTES') …
amichib
  • 115
  • 1
  • 2
  • 7
3
votes
1 answer

How to trigger jenkins pipeline only on merge to develop branch from github webhook trigger?

I am having a problem to trigger Jenkins pipeline job based on merge any branches to develop branch only. I also did not find any webhook for merge as like bitbucket. I also tried using pull request but that triggered the job on any changes to the…
Manish_
  • 108
  • 1
  • 1
  • 7
3
votes
3 answers

Jenkins pipeline: do "Declarative: Checkout SCM" step only

I'm newbie in Jenkins. I've created pipeine with parameters in Jenkinsfile in git. It works fine. Problem is: when I push new parameters into Jenkinsfile, then press button "Build with Parameters", there are no new parameters. I will see them only…
Alexey Vazhnov
  • 139
  • 1
  • 1
  • 9
2
votes
1 answer

How to check if pipeline parameter is empty

I have a pipeline job which includes some parameters: In the pipeline file I have the below code: stage ("create bundle"){ steps{ script{ amd_distribution_create_bundle credential_id:…
arielma
  • 339
  • 2
  • 9
  • 21
1
vote
2 answers

Get vars in Jenkins Pipeline

In FreeStyle Project, I have lots of env vars, which are available from any part of Jenkins' job. I also used ghprb plugin to trigger that job against GH PRs, which added some extra env vars. Later, that job became more complex, so I've decided to…
acd
  • 121
  • 2
  • 6
1
vote
2 answers

Jenkins pipeline retry option triggers two builds at a time, one in execution state other in pending state for a single click

For example I have clicked on retry option at build number 2 in Jenkins pipeline view, where as build number 3 gets start and build number 4 also gets start and awaits at pending state. Why the build number 4 is getting started parallelly and how to…
Shree
  • 11
  • 1
1
vote
1 answer

Extended Choice Parameter: How to load params dynamically from any file for jenkins build job

Though below code works fine individually: extendedChoice description: '', multiSelectDelimiter: ',', name: 'Capablities', quoteValue: false, saveJSONParameterToFile: false, type: 'PT_CHECKBOX',value: 'Chrome_macos10_15, Chrome_win10',…
Mithun Kumar
  • 11
  • 1
  • 2
1
vote
1 answer

Jenkins pipeline fails on script approval, although it was approved

I have a pipeline which fails on script approval: Scripts not permitted to use method org.jenkinsci.plugins.workflow.support.actions.EnvironmentAction getEnvironment. Administrators can decide whether to approve or reject this signature. [Pipeline]…
arielma
  • 339
  • 2
  • 9
  • 21
1
vote
1 answer

Does active choice reactive parameter support hide fields option?

I have the below pipeline: I want that once I choose in the InstllationType the value 'Recreate', some fields will disappear. is it possible to do it with an active choice parameter? if not, is there any other way for doing it?
arielma
  • 339
  • 2
  • 9
  • 21
1
vote
1 answer

Jenkins - Running code in Windows agent but script says we are in Linux

I have the following pipeline (Jenkinsfile): @Library('mylib@master') import com.mylib.* pipeline { agent { label 'WindowsSlaveWS2016' } stages { stage('Demo') { steps { echo 'a' …
joudaon
  • 93
  • 2
  • 8
-1
votes
1 answer

How to restrict only one parameter in jenkins pipeline

I have the below pipeline script with string parameters. The Target parameter will fail if multiple comma separated inputs are provided in Jenkins. How can I restrict the Jenkins pipeline to accept just one value as parameter and not multiple comma…
Narasimha
  • 89
  • 1
  • 1
  • 8