Questions tagged [jenkins-pipeline]

Questions about the Jenkins “Pipeline” plugin suite (formerly “Workflow”). Not about pipelines in Jenkins in general (e.g. using downstream jobs).

0
votes
0answers
7 views

Encountering `Cannot find module webpack/lib/removeAndDo` when deploying Angular project onto S3 from Jenkins

I am trying to deploy my Angular project on AWS as part of one my stages in my Jenkins job. Long story short, I run some tests and then deploy the project using npm run build:serverless:deploy. When I ...
0
votes
0answers
6 views

Gerrit Webhooks integrated with jenkinsFile

started to use your gerrit webhooks in my project. After configure all the settings inside gerrit , I want to define in my jenkinsFile conditions based on the event the webhooks will send to me. Is ...
1
vote
0answers
19 views

Groovy configslurper not accepting strings in input

I want to preface by saying this all worked until SCM redid the jenkins instance, I'm unsure of what they changed but it broke this. I have a config: program { AS{ server=["serv1","serv2","serv3"]...
0
votes
0answers
5 views

When doing multiple jobs in a pipeline Jenkinsfile, how do I capture the logs for the given build

As the title states, I want to capture the logs for all the stages in my build, which looks like this: pipeline { agent any stages { stage('Build First Repo') { steps { ...
0
votes
0answers
4 views

How to make environment variable set by job dsl avaiable in downstream jobs?

The job seeder creates a pipeline job and sets environment variable using job dsl as shown below, this pipeline job triggers another job(say job2) which in turn triggers another job(say job3). I want ...
0
votes
0answers
12 views

How to change directory inside bash script from Jenkinsfile?

In my Jenkinsfile I have cloned one git repo using Git SCM and for relativeTargetDir I added for example "myGit". So it is saved in directory "myGit". After that I need to run my bash script, and ...
0
votes
0answers
11 views

Unable to execute sonarqube scanner with jenkins

I am unable to execute the sonarqube scanner with Jenkins pipeline script. sonarqube scanner version : 3.3.0 Please suggest. stage('SonarQube analysis 3') { steps { withSonarQubeEnv('...
0
votes
0answers
20 views

Error while analyzing java code using SonarQube Scanner

Gradle spring boot code analysis using SonarQube via Jenkins throws error. I have at the root of the Gradle spring boot project my sonar-project.properties file with the following details sonar....
0
votes
0answers
14 views

How to provide keychainPwd in hudson.util.Secret format in Xcode Integration plugin while working with Blue Ocean?

We created Jenkins Pipeline as a Code using Blue Ocean and it was working fine until recently. Now when we try to pass parameters for keychainPwd for Xcode integration plugin in Blue Ocean, it gives ...
0
votes
1answer
16 views

Jenkins declarative pipeline: How to fingerprint a file without archiving it?

I have a Jenkins declarative pipeline job that has the end result of creating some very large output files ( > 2 GB in size ). I don't want to archive these files in Jenkins as artifacts. However, ...
0
votes
1answer
11 views

copying artifact to remote machine using jenkins-pipeline

I have running jenkins in windows machine, i have create build there and artifact is ready, But how can i transfer that artifact to remote machine. I have ssh key and user-id only.(need to be trafered ...
0
votes
1answer
8 views

Programmatically select WarningNext Generation Parsers from a list of strings

How can I feed Warnings Next Generation Plugin a list of strings that would activate parsers? I want to have a common method in my shared lib that looks like this def withWarningNG(def ...
0
votes
1answer
18 views

How to use Boolean parameters as build parameters to copy artifacts?

I have a multi job project PJ1 with Boolean parameters A, B,C. Based on which parameter is chosen, I want the PJ1 to copy artifacts from another job like if A the copy from "TestA47", if B then copy ...
0
votes
1answer
18 views

Docker Container Jenkins Pipeline Script: Permission denied while executing the script

I am running jenkins inside a docker container. I have created a simple pipleline to checkout,build and run docker image, but I am getting the following error. Below is my pipleline script: node { ...
0
votes
0answers
9 views

SecureGroovyScript.script expect class java.lang.String but received SecureGroovyScript

I'm writing a jenkinsfile which allows the dynamic parameters, using the SecureGroovyScript and CascadeChoiceParameter. Here is my code properties([ parameters([ choice(choices: "\nDev" + ...
0
votes
1answer
19 views

How to get name of the job owner in jenkins pipeline?

When someone creates a Test job, we should send email only to him, not for all. How can I get a job owner name? We have teams and when we make a job, the results of it we send to them. But if the ...
0
votes
0answers
22 views

Jenkins pipeline script addition in Free Style Job Vs Pipeline Job

Currently I am trying to build CI/CD pipeline for my micro service deployment. I created declarative pipeline script including repository pull , build , test , kubernetes deployment etc in different ...
0
votes
1answer
21 views

kaniko sh: sleep: not found

I have tried to build images on my k8s cluster using kaniko,i got this: sh: touch: not found sh: sleep: not found container("kaniko") { sh "kaniko -f `pwd`/Dockerfile -c `pwd` --...
0
votes
0answers
22 views

How to fail a Jenkins Job upon runtime failure of a docker process?

My jenkins job triggers a docker process to run. My docker process may exit depending upon any conditional logic and termination of CMD bash script. Once exited, I wish my Jenkins job to fail ...
0
votes
0answers
21 views

How can you pass input data from a web app form to jenkins pipeline?

I want to pass a username and password that a user enters into a web app to use as variables within the groovy script for a Jenkins pipeline. Currently the web app starts the pipeline build by using ...
0
votes
0answers
14 views

Why do failing tests cause entire Jenkins build to be marked as “UNSTABLE” by Allure plugin?

I have set up Jenkins test jobs that will run Cucumber tests and want my jobs to always be successful up until a certain threshold (which I am controlling). The Allure plugin is always marking my ...
0
votes
0answers
37 views

Why can't I access /var/run/docker.sock despite being Jenkins user within docker's group?

I have Jenkins on Docker, both Jenkins master and slave are Docker containers, with mounted var/run/docker.sock. There is proper connection between them, but when I try to run simple docker "hello-...
0
votes
0answers
18 views

How to trigger multi job phase in Jenkins using the Boolean parameters as trigger condition?

I need right direction to set-up my Multijob project to work as per my requirements. My scenario: I have a Multijob pipeline with multiple Global Boolean parameters(A, B, C, a, b, c) that will be ...
0
votes
1answer
35 views

is docker daemon running

I am running jenkins container on kubernetes. for some reason, creating a pipeline that pulls dockerfile from bitbucket and builds an image gives me an error. The pull stage works fine, the problem is ...
0
votes
0answers
8 views

Create a jenkins pipeline, so that they can run only those jobs which are selected by user from drop down, jobs should run sequentially?

I want a jenkins pipeline or a groovy script, to save the jobs which are selected by user from the dropdown list, and run those jobs sequentially? All the jobs are independent of each other? All the ...
0
votes
0answers
20 views

Disable changelog in Jenkins pipeline checkout

I have a Jenkins pipeline that checks out specific commits from several different repos. I would like to disable the calculation of the changeSet (changelog) since the /api/json call to the job takes ...
0
votes
0answers
26 views

java.lang.InterruptedException when I wait for node availability on Jenkins

I have created a method like to be called as myWaitNodeMethod('some name'): def call(String nodeName) { def computer = Jenkins.getInstance().getComputer(nodeName).getNode().toComputer() ...
1
vote
0answers
17 views

Maven update component version in all components using it

My project consists of numerous (~100) components, most of them use ~10 core components. When I update a version of a core component I would like to have up-to-date version of it in every component ...
0
votes
0answers
23 views

Parallel pipeline DSL: Mix between jobs details (downstream) due to parallel

When we are running pipline DSL job sometimes we got cases that in parallel some jobs has wrong details, for example, wrong URLs of the artifcats plug ins, maybe because of the parallel execusion, ...
0
votes
0answers
15 views

Does not work execution of exe file from jenkins job, but works locally from cmd

I have Jenkins-slave on Windows 10. Jenkins service is running, from domain user jenkins. I tested each shell command from cmd. It works. But it does not work in Jenkins-job, when i am trying to ...
0
votes
0answers
13 views

Gerrit Trigger for new patch set through scripted pipeline

We have integrated Gerrit Code Review with Jenkins through Gerrit Trigger plugin, So with free style job able to validate each patch set pushed to gerrit. It is working perfectly. Now we have ...
0
votes
1answer
18 views

How can I chain build pipelines in a blocking fashion?

I am trying to configure a Jenkins pipeline in the following fashion : Build A , B and C non blocking as they don't depend on each other (but block on the fact that A , B and C are still building) ...
1
vote
2answers
25 views

Retrieve Repository URL field Jenkins

is there a way to call via code the GUI field "Repository URL" in order to use its value on my Jenkins pipeline?
0
votes
0answers
10 views

How to integrate Service Now in jenkins pipeline script?

I have to tried to integrate Service now with jenkins. i have installed the Service Now plugin https://github.com/jenkinsci/service-now-plugin/blob/master/README.md in my environment. I need to get ...
0
votes
1answer
16 views

How to exclude directory and files from NuGet package built with Octopack via Jenkins?

I have a windows service that I need to pack into a nuget package with OctoPack, but I have to exclude a directory called "Config" and a few other config files (these are instance specific and this ...
0
votes
0answers
23 views

Jenkins - How to run - docker system prune - in the pipeline

This is my Jenkinsfile for building docker image and pushing it to dockerhub. Everything works just great. I would like to clean up the untagged images after the build process. Currently I do docker ...
0
votes
0answers
11 views

Running YAML code in Jenkins Pipeline for Environment Provisioning

My company's tool stack for running a CI/CD pipeline include the following tools: Jenkins - Pipeline orchestration IBM UrbanCode Deploy (UCD) v6.2.6 - Application deployments IBM UrbanCode Deploy ...
0
votes
0answers
12 views

Add Build Step is not working in Jenkins for any of the option like “Execute Shell” or “Invoke Ant”

While configuring a job in Jenkins "Add Build Step" is not working for any of the option like "Execute Shell" or "Invoke Ant" Tried this step in all browsers like chrome and firefox and IE but got ...
0
votes
3answers
23 views

Replace a file content with environment values - Jenkins

In my Jenkins pipeline, I load the environment properties from a file using plugin. With this I would like to replace a file content with the environment variables loaded or available. Example: ...
0
votes
1answer
18 views

Set environment variables in Jenkins Declarative Pipeline

Below is my code for deploy stage in jenkinsfile stage('Deploy') { node('slave1') { if ("${env.Build_testapp1}" == 'true') { script { env.packageid = "Applications/...
-1
votes
1answer
13 views

how to skip the stage if my build stage fails in jenkins pipeline?

I am using three stages here , In this if my second stage Build fails it should skip the third stage copy. may i know how to use conditions here in pipeline job? node('') { stage ('clone'){ Build ...
3
votes
1answer
23 views

How do I retrieve last console output of a jenkins job using python-jenkins?

I'm unable to extract the jenkins console output of a given job using python-jenkins. I must to extract the full console output of a given build #. Here is how my jenkins url looks like: http://...
0
votes
1answer
25 views

How to get the master branch build numbers

I have recently started learning groovy. I am interested to know , is there a way to find get the build numbers of master branch. I have build numbers for different branches like hotfixes,patches , ...
1
vote
1answer
27 views

Is there a way to lock down deployments to only be during a specific time of day?

I want to be able to only deploy anytime between 9:00am and 6:00pm on certain days. I already have the builds locked down by day using "Set approvedDays" but I need one for hours.
0
votes
0answers
11 views

Download Maven artifacts in Jenkins from another repo if one fails

In my Jenkins build I have a settings.xml file for pulling Maven dependencies. An artifact, if not found, should be downloaded from another Maven repo not specified in a settings file. Can this be ...
0
votes
0answers
25 views

How to get the successful build numbers of master branch of another job using groovy

i am new to groovy script. i have 2 jobs deploy_job and build_job. i want successful build numbers of master branch of build_job I need to write a groovy script in deploy_job that gets the successful ...
0
votes
0answers
4 views

Does a Jenkins plugin exist that adds stage dependency to a pipeline, similar to how Gradle has dependsOn(), doFirst(), doLast() etc

I would like to have stages depend on each other to run in a Jenkins pipeline. Ideally I would be able to define the stages in any order within the pipeline, but have them execute according to their ...
0
votes
0answers
11 views

How to inject from environment variable from jenkins declarative pipeline to jelly template before sending mail in jenkins?

Exactly as in question. I defined environment variable in declarative pipeline of jenkins and want to pass inside jelly template at the end of the pipeline so the mail about failure contains info ...
0
votes
0answers
8 views

How can I get status of build in declarative pipeline below

script{ build job : 'somejob', parameters: [ extendedChoice(name: 'some_choice', value: "${env.some_choice}") ], propagate: false } echo "${currentBuild.Currentresult} ...
0
votes
0answers
25 views

How to trim the spaces in jenkins parameter value?

I am trying to build the pipeline job with parameters. If i have spaces in the parameter value the build is getting failed. I tried trim :true but it also getting failed. I am using jenkins version 2....