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

Jenkins groovy global lib declarative pipeline error

My jenkins file has below two line @Library(['global-jenkins-lib@master']) _ driBuildPipeline {} It is calling "driBuildPipeline.groovy" under VAR dir of global-jenkins-lib. my script is a below: def call(body) { def pipelineParams = [:] …
0
votes
0 answers

Trigger multiple builds parallel at one fire in Jenkins Pipeline

Context I have a few Jenkins pipelines which are based on the regex to select the matching jobs to run. The number of downstream jobs for each pipeline around 60. So I have written down the declarative scripts to select these matching job then built…
0
votes
2 answers

How to pass selected values of active choice parameters to build script

I'm new to Jenkins, please help me on this. I have a maven project which is bit complex so I have separated the tests using testNG xmls. Based on the execution flow I will selects the appropriate .xml file to build the project. For now what I'm…
0
votes
3 answers

Jenkinsfile load groovy file parameter in key and value format in environment variable in pipeline

besically my groovy file jenkins-build-paramters.groovy is as below Cotaining_WAR_Deployment='true' Cotaining_JAR_Deployment='false' Below is my environment variable environment { Cotaining_WAR_Deployment= "true" …
0
votes
1 answer

Jenkins declarative pipeline load parameters in pre condition

in jenkins declarative pipeline is there a way to execute pre condition whereby it should load build parameters from a file. In Jenkins there is an option whereby we can restart individual stage. Therefore, i wish for each stage to load the…
0
votes
1 answer

Extract branch name from Git in Jenkins declarative pipeline when using pipeline as code

I am working on a Jenkins declarative pipeline, the pipeline get's trigger whenever there is change in release branch. Release branches are named in this format : release/v1.0 , release/v2.0 etc. We are using below Git PollSCM stage to checkout…
0
votes
0 answers

Set a relative timeout threshold for a Jenkins Pipeline

At some point when I was using Jenkins in the past, it was possible to set a relative timeout threshold (e.g. if the build takes 50% more time to complete than you fail it). Now it seems that the way to impose timeouts in a Jenkins Pipeline is to…
Uko
  • 13,134
  • 6
  • 58
  • 106
0
votes
2 answers

Set variables in a list in Declarative Jenkinsfile

I have set some environment variables as below : environment { IMG_TARGET = "registry/cloud-environemnt-azu:1.x.x" CREDENTIALS = 'credentials-token' BUILD_DIR = 'Builddir' DOMAIN_DIR = 'Domaindir' BUILD_SOLUTION =…
0
votes
0 answers

Substitute values from property file in Jenkinsfile for dynamically set variables

I have a Jenkinsfile with multiple parameters that are environment-specific. The values for those parameters are stored in a property file. I am trying to set the variables based upon the selected environment and then replace their values from the…
0
votes
1 answer

Call Multibranch pipeline A from Multibranch pipeline B located in 2 different folders in Jenkins

I am working on organizing my jobs using folder in Jenkins. This is how my multibranch pipelines are…
0
votes
0 answers

Jenkins Declarative pipeline: send email notification with test report in post stage

I have a simple pipeline script with two stages (test stage and post-stage) in the post-stage, where I send a notification if the build is failed or unstable. However, I am able to send a notification with job name, build number and the console…
0
votes
1 answer

Run multiple stages of Jenkins declarative pipe line in same docker slave

Objective Objective here to migrate a scripted jenkins pipe line to declarative .Scripted pipe line is running on docker slave managed by kubernetes and the working syntax is as below slave =…
0
votes
1 answer

Jenkins - add an option to stop scheduled build

I am working on a declarative pipeline which it is scheduled to run everyday after a certain time to shutdown an environment when not used (and restart it the morning after). However, sometimes tests need to be run on that environment and therefore…
0
votes
2 answers

Jenkins writeYaml before pipelines starts and read in agent.kubernetes.yamlFile

I have a pipeline that needs a modified yaml file for different environments. For that I read the template, overwrite the parameter and save it again before the pipeline { ... } part starts. node { stage('Adjust serviceAccountName to env') { …
Sam_Ste
  • 334
  • 2
  • 16
0
votes
0 answers

Jenkins shared declarative pipeline

I have several projects with very similar pipelines, e.g.: pipeline { agent any environment { JAVA_HOME = '...' } options { timeout(time: 1, unit: 'HOURS') } parameters { extendedChoice( …
Big McLargeHuge
  • 14,841
  • 10
  • 80
  • 108