Questions tagged [jenkins-declarative-pipeline]

A plugin tool for Jenkins which presents a simplified and opinionated syntax on top of the Pipeline sub-systems.

483 questions
0
votes
1 answer

How to pass parameters to bash command within stage/steps in Jenkins declarative pipeline?

I started to use Jenkins recently. I provides two parameters to collect the dynamic settings and would use them in later stage/steps part (in a bash script). I refer some examples such…
Yongzhi.C
  • 141
  • 1
  • 2
  • 9
0
votes
0 answers

Jenkins declarative pipeline incorrect svn change list

I have a freestyle project I'm trying to move to a declarative pipeline project in jenkins. It uses SVN and the project is set up to poll the SVN repo and use a Jenkins file from the SCM for configuration. All of this works correctly. My issue is…
0
votes
1 answer

Jenkins Pipeline Downstream Jobs - continue with next job at specific stage

Background We have multiple declarative pipeline jobs that can be selected and built in order as downstream jobs from a Master pipeline job. This will wait for each triggered job to complete before starting the next one inline. Each of the…
0
votes
0 answers

Access another directory in other job declarative pipeline

I have the following problem : - I created a job, which called "job1", contains four directories. How can I access one of those directories if I created "job2". I am using the declarative pipeline Example: Let's say the first job1 have the…
0
votes
3 answers

Jenkins: How to skip a specific stage in a multibranch pipeline?

We have "stage (build)" on all our branches. Temporarily how can we skip this stage to run on all our branches in multibranch pipeline. I know one solution is use when condition on stage and ask all developers to pull that branch into their…
0
votes
2 answers

Webhook| Gitlab | jenkins pipeline |Declarative syntax

I'm trying to integrate Webhook with gitlab and jenkins. I have done it via upstream downstream jobs using the URL. While trying to rece=reate the same via declarative pipeline, I'm in a stanstill pipeline { agent any stages { …
0
votes
1 answer

Jenkins pipeline fails without error

My Jenkins Pipeline fails even though no stage has an error: The console log also shows no problems, but Build status: FAILURE. Any tips on how to troubleshoot this would be appreciated.
Pabi
  • 891
  • 3
  • 12
  • 18
0
votes
1 answer

How do you run an "input" stage only on master in Jenkins declarative pipeline?

I have a stage in Jenkins declarative pipeline that I want to run conditionally when manually triggered, and only on the master branch. stage('Deploy to prod') { when { branch 'master' } input { message "Deploy to prod?" ok…
Matt R
  • 9,892
  • 10
  • 50
  • 83
0
votes
1 answer

Jenkins declarative pipeline: input with conditional steps without blocking the executor

I'm trying to get the following features to work in Jenkins' Declarative Pipeline syntax: Conditional execution of certain stages only on the master branch input to ask for user confirmation to deploy to a staging environment While waiting for…
Matt R
  • 9,892
  • 10
  • 50
  • 83
0
votes
1 answer

Using variables created inside other job build inside on Jenkinsfile

I need to read some vars created inside another job. Easier to be explain with pseudo code: my job: { build job:"create cluster" //this job will create some vars (cluster_name) //used this var from my job echo "${cluster_name}" } The best will be…
0
votes
1 answer

How do I get a file from a one-off process in Kubernetes?

I have a test process which produces a file as an output. I want to start this test process during a build, run it to completion, then collect the file that it produces and copy it back into the build context. What is the correct way to do this in…
0
votes
2 answers

Need to pass git sha to checkout to Jenkins multi branch pipeline

Is it possible to use parameters to allow users to pass a git sha to a multi branch pipeline while defaulting to the head of the branch? Also I would only need to this function for the master branch. I'm using ... Jenkinsfile in code Jenkins…
0
votes
1 answer

Jenkins powershell plugin don't work in declarative pipeline

I'm trying to run a powershell script in a declarative pipeline job, but it don't work. It seems to work, but don't do nothing. This is a part of my pipeline pipeline{ agent{ label 'windows' } stages { . . …
0
votes
1 answer

How to get a value returned from a method in a shared library in declarative syntax?

I'm using pipeline declarative syntax and I need to get a value returned from a method in a shared library pipeline{ String label= new Define.getLabel() agent (label ${label}) // stages, options ... }
0
votes
1 answer

Jenkins Pipeline file

I am in the process of writing a declarative jenkinsfile to build a pipeline project. Some of the steps within a few of the stages will require some remote commands to be run. The remote ssh sites have been configured in the main jenkins…