A plugin tool for Jenkins which presents a simplified and opinionated syntax on top of the Pipeline sub-systems.
Questions tagged [jenkins-declarative-pipeline]
483 questions
0
votes
2 answers
Jenkins Declarative Pipeline: how to wait before and after input on when directive
In my Jenkinsfile, I have 2 stages: Pre Live and Live. I ask the user for input on stage Pre Live to know whether a deploy should be done to a pre live environment, and then on stage Live, I ask the user again for input to know whether to do a…

Tiago Silva
- 455
- 5
- 20
0
votes
1 answer
Jenkins Triggering of a Build Step/Stage(not the entire job) at a given interval
I am trying to build a pipeline where i would need to chain multiple jobs and some of them has to start at a certain time.
Ex: Job1(starts at Midnight) -> Job2 -> Job3 ->Job4(starts at 4 PM)
Using Declarative Syntax:
pipeline {
agent any
…

Anirudh C
- 39
- 5
0
votes
1 answer
Jenkins Pipeline - How to fix syntax error in matrix section?
I've been trying to configure a matrix section in a declarative pipeline, but it keeps failing.
In the official documentation, it states:
Stages in Declarative Pipeline may have a matrix section defining a multi-dimensional matrix of name-value…

Moshe Zvi
- 437
- 4
- 8
0
votes
1 answer
How to scale up/down the stages in Jenkins Pipeline, based on the choice parameter we are selecting?
Based on the parameter selected (Eg. choice - in this case), need to scale up/down the pipeline stages.
if(choice.equals("four")){
pipeline{
<4 stages>
}
}else{
pipeline{
<3 stages>
}
}
Is it possible to implement…

Kanaga Manikandan Gopal
- 141
- 2
- 3
- 9
0
votes
1 answer
Where to store Jenkinsfile for downstream pipeline without its own repo
I'm in the process of setting up Jenkins pipeline jobs for our build. We previously used Freestyle jobs to build each of our repos, with various extra manually triggered jobs at the packaging and deployment stages.
We have the following Pipeline…

Chris R
- 2,464
- 3
- 25
- 31
0
votes
0 answers
Multiple downstream stages to a set of parallel stages
In a declarative Jenkins pipeline, I need to introduce a stage X as another downstream for multiple upstream stages (B1, B2) which already have their corresponding downstream stages (C1,C2).
The visual representation of existing pipeline is as…

Nazil Khan
- 135
- 2
- 9
0
votes
1 answer
Jenkins job getting stuck on execution of docker image as the agent
I have installed Jenkins and Docker inside a VM. I am using Jenkins pipeline project and my jenkins declarative pipeline looks like this.
pipeline {
agent {
docker { image 'node:7-alpine' }
}
stages {
stage('Test') {
…

Tarun Chawla
- 321
- 1
- 2
- 11
0
votes
1 answer
How can i change agent inside a method in Jenkins declarative pipeline, by passing it as a parameter?
I have a pipeline script, where same methods need to be executed in different agents.
I have methods defined for common functionality, however i would like to pass agent as a parameter to method and execute the function. Which basically results in…

Shruthi Bhaskar
- 1,212
- 6
- 20
- 32
0
votes
0 answers
Load declarative pipeline from inline function
I've seen this example on how to load declarative piplines form a shared Library:
https://jenkins.io/doc/book/pipeline/shared-libraries/#defining-declarative-pipelines
But I would like to have the pipeline as inline functions:
def linux_platform =…

Nils
- 382
- 3
- 12
0
votes
1 answer
Curl 28 timeout when trying to upload a file to sharepoint through a curl request in a Jenkins Pipeline
Uploading a zip file to sharepoint with a curl request in Jenkins pipeline, timing out with "curl: (28) Connection timed out after 300905 milliseconds"
I have tried reformatting the request and changing syntax in Jenkins but no joy. I have a "curl…

Deane Kane
- 126
- 2
- 15
0
votes
1 answer
Jenkinsfile - Creating output from shell script with newlines
I am currently trying to do the following inside of a declarative pipeline in Jenkins. I have a certificate in a file and I am trying to put this in a kubernetes secret. Now my problem is the following.
As the file contains newlines passing it as a…

relief.melone
- 3,042
- 1
- 28
- 57
0
votes
1 answer
Pure declarative jenkins pipeline: variable across stages
I would like to set a variable in one stage and use that in a following stage in a pure declarative Jenkins pipeline.
I DO NOT want to:
Use a script block to set the variable.
Use a temporary file to store the value.
Is it possible?
Things I have…

Arnab
- 1,308
- 1
- 13
- 18
0
votes
1 answer
Jenkins pass trigger block to Shared Library Pipeline
I have a Shared Library containing a declarative pipeline which numerous jobs are using to build with.
However I want to be able to pass the trigger block in from the Jenkinsfile to the Shared Library as some jobs I want to trigger via Cron, others…

apr_1985
- 1,764
- 2
- 14
- 27
0
votes
1 answer
Build with declarative pipeline does not work Jenkins, but works with Scripted pipeline
I am getting sources from git, next my step is replace of needed variables in these sources, next step build these sources in the docker container. How it works with scripted pipeline.
node('jenkinsslave') {
stage('Remove old sources'){
sh…

Piduna
- 609
- 12
- 28
0
votes
1 answer
Jenkins declarative pipeline upon Bitbucket pull request
I am building a declarative pipeline Jenkinsfile for semantic branching. It has the format:
pipeline {
stages {
stage('develop branch build') {
when {
branch 'develop'
}
// build and deploy to QA environment
}
…

funkybro
- 8,432
- 6
- 39
- 52