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

Multiple Jenkins parameterized build value pass value to Jenkinsfile for declarative pipeline

Hi my Jenkins project is parameterised build. I have 3 variables. 1 choice and 2 string parameter. The choise perameter is do_you_want_to_deploy and string parameter is git_tag and git_branch. I want to know how can i pass this value to a…
0
votes
0 answers

How to debug jenkins pipeline failure while Jenkins killed process

The goal: build an Angular app My Jenkins setup: master >> slave >> node docker I'm trying to build an Angular app on the slave via docker, The installation works well and the code runs on the docker node image. node works well - relevant log +…
0
votes
1 answer

choice parameter inside parallel stage declarative pipeline

I am not able to echo A or B or C when using condition in parallel block. I have used choice params for it. It work when I am using global params but I want to use it in under one stage. Pipeline: pipeline { agent any parameters { …
0
votes
1 answer

Setting environment variable in Jenkins pipeline stage from build parameter

I would like to configure an environment variable for my Jenkins pipeline, but dynamically based on an input parameter to the build. I'm trying to configure my pipeline to set the KUBECONFIG environment variable for kubectl commands. My pipeline is…
zodac
  • 285
  • 10
  • 26
0
votes
0 answers

How to Enable Multi String Parameter and File Parameter, based on the previous parameter selection in Jenkins?

In a Jenkins Pipeline, I have 3 parameters. 1) SELECTION (Choice or Active Choices or Any choice param type) - Upload File. (This option points to the parameter: UPLOAD_FILE) - Enter the file Content directly. (This option points to the…
0
votes
1 answer

Jenkins Declarative pipeline get build failure cause

I recently converted a scripted pipeline into a declarative pipeline but having trouble to get the build failure case in the post section. For a scripted pipeline, I can easily wrap the pipeline inside a try-catch and have access to the exception…
0
votes
1 answer

Using the govc container in Jenkins

I'd like to run govc commands in a Jenkins pipeline. Running the govc container manually works: docker pull vmware/govc && docker run -e GOVC_USERNAME=$GOVC_USERNAME -e GOVC_PASSWORD=$GOVC_PASSWORD -e GOVC_INSECURE=$GOVC_INSECURE vmware/govc find…
towel
  • 2,094
  • 1
  • 20
  • 30
0
votes
1 answer

Jenkins string variable to Ansible string variable

may I ask if there is a way where jenkins string variable can be handled by Ansible when triggering the playbook? I noticed that when I passed the string variable of Jenkins to Ansible the variable becomes incomplete. let say the variable…
0
votes
1 answer

Jenkins Pipeline Run Stage On Failure

My Jenkins pipline script has a lot of try/catch blocks to notify me when there is a failure. Is it possible to have a stage that will only run if a previous stage fails? My current script looks something like this. stage('Stage 1') { steps { …
0
votes
0 answers

"Restart from Stage" missing from Jenkins UI and Blue Ocesn

I am looking for solution where I can restart my Jenkins pipeline job from any failed step. Sample pipeline script: timestamps { node () { stage ('Checkout') { bat label: '', script: 'echo "stage Checkout"' …
0
votes
0 answers

Declarative pipeline Jenkins groovy.lang.MissingMethodException

pipeline { agent any stages { stage('Checkout SCM : Some Git repo') { steps { checkout([$class: 'GitSCM', branches: [[name: 'refs/heads/proj_dev_branch']], doGenerateSubmoduleConfigurations: false, extensions:…
0
votes
0 answers

How to get the current node's name from a nested node in Jenkins Pipeline?

I have a Jenkins pipeline and I am trying to get the NODE_NAME of the nested NODE that I switch to. Example: @Library('git lib that we use') import org.our_git_lib.* import java.text.SimpleDateFormat node("master") { stage("Do something") { …
hiquetj
  • 410
  • 1
  • 8
  • 23
0
votes
1 answer

How to run "sudo su" command in Jenkins Declarative pipeline?

I have a strange situation where the shell command "sudo su" is not working as expected in Jenkins Declarative pipeline. Below is my code: stages { stage('Ansible-dynamichost-generation') { steps { …
0
votes
2 answers

withMaven UNSTABLE build result is not preserved in Jenkins declarative pipeline

I want to set a build's result to UNSTABLE when a maven build step exits because of test failures. I'm using the withMaven build step which provides special treatment of maven test results: In case of failing tests, it sets the build result to…
Harald Albers
  • 1,913
  • 16
  • 20
0
votes
0 answers

Jenkins multibranch pipelines waiting for other executors instead of completing post actions

I'm running a single-node Jenkins instance on a project where I want to clean up closed PRs intermittently. The system can keep up just fine with the average PR submission rate; however, when we re-run the scan repository against the project the…
JPeterson
  • 77
  • 1
  • 9