The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

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
3 views

Run a slice of sandbox WorkflowScript on Jenkins Script Console

When running a Jenkins pipeline as a code script its class is WorkflowScript: echo this.toString() Result: ... [Pipeline] echo [email protected] [Pipeline] End of Pipeline Finished: SUCCESS ...
0
votes
0answers
5 views

Can I run the jenkins high level stages in parallel?

I have a groovy script to some tests in parallel but I cannot restart the stages Installation1/Installation2 manually from the jenkins UI. Is there any other way to do this so that I can restart a ...
1
vote
0answers
9 views

Not serializable error for jenkins declarative pipeline

I am trying to trigger my email promotion job from my pipeline which extracts the repo name from Jenkins messages. But not able to resolve the SerializableException error for this block. Any help is ...
0
votes
0answers
7 views

Send email only when environment variable has specific value in Jenkins

I have Master-Slave jenkins setup. In one of the jenkins job, I need to send an email via Editable Email Notification plugin only when environment variable has specific value. So I am setting the ...
0
votes
0answers
9 views

Is it possible to schedule a step in Jenkins pipeline?

What ideally I need to do is run a Jenkins pipeline that will run immediately after I start the execution , checking out code, running a build but just running the deployment in a particular date/time....
0
votes
0answers
5 views

Multibranch Job Tear Down Plugin Jenkins not taking parameters

I am using the Multibranch Job Tear Down Plugin from Jenkins to take down all the branch-specific resources that I may have created. I am calling this plugin through the Jenkinsfile of that branch. ...
0
votes
0answers
9 views

Jenkins Multibranch Pipeline Lightweight Checkout

The Jenkins Pipeline plugin has a feature known as "lightweight checkout", where the master only pulls the Jenkinsfile from the repo, as opposed to the entire repo. There's a corresponding checkbox in ...
2
votes
2answers
29 views

Get the cause of a Maven build failure inside a Jenkins pipeline

I have a Jenkins scripted pipeline set up where I execute a number of Maven builds. I want to treat one of them as non-fatal if the root cause is a known one. I have tried to achieve that by ...
0
votes
1answer
15 views

How to add name to each step in jenkins pipeline stages

stage('type checking') { steps { script { docker.image('node:8').inside() { sh ''' npm run lint npm run type-check ...
0
votes
0answers
13 views

Why is Gradle Plugin not collecting build scan in Jenkins file

I have a Jenkinsfile based pipeline which does a build using gradle, which then produces build scan that goes in console output. I found a Jenkins plugin (https://wiki.jenkins.io/display/JENKINS/...
0
votes
0answers
9 views

Trigger pipeline to rerun all jobs if master gets updated

I have a multi-branch pipeline setup to build off of PR creation/updates and master branch changes. So if I make changes and create a PR a unit test job will build, and if that passes and I merge into ...
0
votes
0answers
12 views

How to fix “java.lang.ClassNotFoundException: org.apache.maven.model.io.xpp3.MavenXpp3WriterEx” for mvn help evaluate

I am trying to get modules in my pom.xml by using below command. This was working till yesterday. Maven artfiact is stored in artifactory and am using .m2/settings.xml to connect to central and ...
0
votes
1answer
17 views

How do you print out the value of a class property in a Jenkinsfile?

I'm creating a Jenkinsfile for use with GitHub Enterprise. I used the GUI settings in the pipeline job to specify a Jenkinsfile from a GitHub repo. I'm using the scripted syntax instead of the ...
0
votes
0answers
4 views

Options for a Multibranch Pipeline on an Azure Devops repository?

When you configure a multibranch pipeline, you have to give it at least one a source for under "Branch Sources". When using a GitHub or a BitBucket repository, you are able to add them as GitHub or ...
0
votes
0answers
15 views

How to schedule a parameterized Jenkins job

I have a multibrach Jenkins pipeline job which accepts some parameters from users following 'Build with parameters' option. Now, I need to schedule this job to run on the monthly basis. Since, the job ...
0
votes
0answers
6 views

How to use upstream trigger for multibranch declarative pipeline

I'm trying to configure a trigger in my declarative pipeline to be executed after another build. Jenkins provides the upstream trigger for that and I would like to use variable to prevent hardcoded ...
1
vote
0answers
17 views

Why does this declarative pipeline fail in my shared library?

I have a shared library containing a declarative pipeline used in a repo Jenkinsfile (it is in fact called through an intermediate): Jenkinsfile -> bupJavadocApiPipeline.groovy -> bupMavenPipeline....
0
votes
0answers
12 views

Is there a way to specify that a parameter is mandatory on Jenkins pipeline parameters directive?

I wonder, if there is a standard way to tell jenkins pipeline that a parameter is mandatory. If it is null or empty - give an error and exit. Or maybe even better - give some regular expression to ...
0
votes
1answer
7 views

Adding remote folder to exported files

I'm working on a jenkins job where I access a remote repository, build the project and export a few files. What I need to do is to integrate another remote folder from another repository to the ...
1
vote
1answer
15 views

Is there a way to use “propagate=false” in a Jenkinsfile with declarative syntax directly for stage/step?

You can use propagate on a build job as described here: https://jenkins.io/doc/pipeline/steps/pipeline-build-step/ So you can use something like this to prevent a failing step from failing the ...
1
vote
1answer
29 views

Last successful build's revision for an upstream MultiBranch Job in Jenkins Declarative Pipeline

I'd like to get the build revisions of the last successful builds of Upstream jobs. The upstream jobs are multibranch jobs. So far I'm generating a list of upstream jobs' names as triggers. But I can'...
0
votes
0answers
12 views

Jenkins RejectedAccessException in whitelisted method

In Jenkins 2.46.3 I'm trying to get the cause of the build (ie whether it was started by a git trigger or a human clicking "build now"). In an answer to another SO question it is suggested that ${...
0
votes
0answers
20 views

How to access argument's function within sh scope in Jenkins Declarative Pipeline [duplicate]

I need to access the argument of the function into the stage. This is a parametrized stage. The argument is dynamic, so it cannot be defined into environment. How to access ${job} argument into sh''' ...
0
votes
1answer
19 views

Jenkins Parameter to Terraform variable

I'm trying to set up Jenkins as a mini portal. User starts a parameterized build and selects a region from a dropdown. What I am missing (do not know if it's possible) is how I would pass the ...
0
votes
1answer
13 views

Get Downstream Job Details in the Upstream Job

I need to get the downstream job details so that I can update this in my Upstream Job short desc or some log file. But I'm unable to find any call that will work. For getting the Upstream Job info, ...
0
votes
1answer
11 views

How to iterate over nodes to run commands in Jenkins Pipeline

I am trying to iterate over a list computers and run a command while on the respective node. Problem is whenever I run it I get a NullPointerException. In the console log it shows that it is running ...
2
votes
0answers
24 views

jenkins pipeline script close() getting called without executing Closure

The following Jenkins pipeline script does not execute the code in the Closure. class MyClass implements Closeable, Serializable { private final script MyClass(final script) { this....
0
votes
1answer
12 views

Unable to link two “sidecar” containers in my Jenkins pipeline

Currently, I am hitting an external DB to carry out unit tests in my pipeline. I want to increase runtime of the build by implementing local testing within the pipeline. I'm attempting to use this ...
0
votes
0answers
9 views

How to properly wait for Jenkins slave?

I am using this code to dynamically create Jenkins slaves from a pipeline. SSHLauncher launcher = new SSHLauncher( hostname, sshPort, credentialsId, jvmOptions, javaPath, ...
1
vote
1answer
16 views

What is the meaning of build according to Jenkins site

According to the official site of Jenkins https://wiki.jenkins.io/display/JENKINS/Terminology it gives a very vague but more wider meaning of the term build. Can anyone please explain the meaning of ...
0
votes
1answer
27 views

how to use ${TEST_COUNTS,var=“TYPE”} in pipeline email ext content

I can`t get the numbers of build result(e.g. total, pass) by ${TEST_COUNTS,var="TYPE"} and email content is emailext subject: "Automation Result: Job '${env.JOB_NAME} - ${env.BUILD_NUMBER}'", ...
0
votes
0answers
15 views

WebHook gets “Multiple candidate revisions” in Jenkins pipeline

I have a Jenkins pipeline job that triggered by WebHook (push / PullRequest). The job is trigged by the WebHook but I'm getting "Multiple candidate revisions" message on Jenkins job log and it is ...
2
votes
1answer
43 views

How to set a default value for a variable in case of a timeout step?

I have a pipeline step which waits for user input and has a timeout value of 1 minute based on this solution def deployFlag : : timeout(1) { script{ deployFlag = input message: 'Deploy ...
0
votes
1answer
26 views

Jenkins scripted pipeline does not fetch the test result if unit test fails

I have gradle based java projects with junit tests which I'm building CI jobs for. I was successfully able to integrate slack with Jenkins using slack Slack Notification plugin. Jenkins Version : 2....
0
votes
0answers
12 views

Date and time picker using a calendar in jenkins pipeline userinput to set sleep time

Requirement: In jenkins pipeline, between stages user will receive an approval email to approve the pipeline workflow and set the job sleep time to postpone the stage (consider which will be for ...
1
vote
1answer
25 views

escaping sed-statement in jenkinsfile

I'm trying to script a pipeline in jenkins to build a docker image and deploy it via helm to kubernetes. the version number of the chart and docker-image is a SemVer with a shortform of the git commit-...
0
votes
0answers
12 views

Jenkins build from tag using Bitbucket Branch Source plugin

I would like to build my jenkins pipeline when I create a tag in master branch in bitbucket. I have jenkins building on commit of master branch, but I can not seem to get it to build for creation of a ...
0
votes
0answers
22 views

Use of Jacoco in Jenkins pipeline [duplicate]

I have a Jenkins pipeline, where I am running unit tests and Integration tests with coverage provided by jacoco Maven plugin, with a fat Jar as resulting artifact. I was wondering If I could use this ...
1
vote
1answer
40 views

Jenkins deploy artifact on same server

I'm trying to create a Jenkins Pipeline or group of itens to help me create a custom CI/CD for my projects and right now i'm stuck at the deploy part, i want to deploy on the same server that my ...
0
votes
1answer
27 views

Groovy jenkins pipeline @NonCPSreturn not expected results

In my code I have a method that parse log file and return list of results. Without NonCPS it works perfect and return correct values. This method is called from pipeline stages and I got java.io....
1
vote
0answers
47 views

I have a problem with this error output = Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-install-x0egt255/mysqlclient/

I'm trying to create a pipeline for code automation deployment to the openshift cluster, but when the pipeline were on the installing requirement stage there's always an error on installing mysql, is ...
1
vote
1answer
23 views

How to publish xUnit and jUnit test resultz to gitlab

I have a jenkins pipeline with test stage that triggered via hook on gitlab. Is there any way to publish test results under gitlab for the triggered build? Thank you
1
vote
1answer
17 views

Generate .trx file without timestamp

Before the following command generates my-test.trx but by updating our server it generates my-test_2019-04-14_09-59-39-114.trx. And this is not mentioned in its document (https://aka.ms/vstest-report) ...
1
vote
1answer
72 views

jenkins dsl job script: How to access environment variable, (which is injected via propertiesFile, ) in downstreamParameterized step

my dsl job script in brief job('test') { steps { shell('echo VERSION=$VERSION > version.txt\n' + 'echo VERSION_SUFFIX=$VERSION_SUFFIX >> version.txt\n' + 'echo ...
1
vote
0answers
21 views

Can a freestyle Jenkins job configured with only Deploy war to container plugin be parameterized + corresponding groovy syntax in jenkins pipeline

I tried/google to get equivalent groovy snippet which would do exact activity which "Deploy war to container" does for a Freestyle job. Whatever I found in more than a week perm-comb are concluding ...
1
vote
0answers
16 views

Problem when invoking Ansible from Jenkins

When i Invoking Ansible through Jenkins i have added the below script in my Playbook - name: HELLO WORLD PLAY hosts: webserver become: yes become_method: sudo tasks: - debug: msg: "...
1
vote
0answers
20 views

how to show in jenkins a multi select list option with a single choice list beside each multi-select list value?

in my jenkins job if i enter a ticket number My jenkins job should go to jira and get a list of values. these values should show as a multiselect list option in jenkins. for each value in ...
1
vote
0answers
20 views

Jenkins Kubernetes plugin SSL errors when launching JNPL

My system is OKD 3.11, Jenkins latest running in its own project. My company uses an internal CA authority. And everything is signed by it. Which is a pain in itself, but I am trying to get my ...
1
vote
1answer
22 views

gradle.properties will be overridden by Jenkins environment variables on a build?

my question is how setting variables using gradle.properties in an Android project, when I run a job in Jenkins CI, and I set the variables to override the ones in gradle.properties. Will this ...
1
vote
1answer
21 views

how to read from configfile in jenkins pipeline BEFORE stages

I have configfile, which is a JSON file. I want to be able to read it before any steps, as it provides variables I need to execute them. However, I don't know where do I put that. To contain config ...