jenkins-2

How do i use the “Publish TAP Results” plugin on Jenkins 2.0 Pipeline?

两盒软妹~` 提交于 2020-01-02 10:22:36
问题 I would like to use the "Publish TAP results" plugin on Jenkins 2.0 pipeline. I'm not sure of the equivalent Groovy script for the same. Can someone help? 回答1: This support was added to the TAP plugin 2.0 (2016-08-20). Usage: step([$class: "TapPublisher", testResults: "**/target/tap-unit.log"]) https://issues.jenkins-ci.org/browse/JENKINS-34000 回答2: Currently there is no support for the pipeline, see https://issues.jenkins-ci.org/browse/JENKINS-34000. But you can create on GitHub a pull

How do i use the “Publish TAP Results” plugin on Jenkins 2.0 Pipeline?

别说谁变了你拦得住时间么 提交于 2020-01-02 10:21:15
问题 I would like to use the "Publish TAP results" plugin on Jenkins 2.0 pipeline. I'm not sure of the equivalent Groovy script for the same. Can someone help? 回答1: This support was added to the TAP plugin 2.0 (2016-08-20). Usage: step([$class: "TapPublisher", testResults: "**/target/tap-unit.log"]) https://issues.jenkins-ci.org/browse/JENKINS-34000 回答2: Currently there is no support for the pipeline, see https://issues.jenkins-ci.org/browse/JENKINS-34000. But you can create on GitHub a pull

Jenkins kubernetes plugin not working

你离开我真会死。 提交于 2019-12-29 06:23:17
问题 I am trying to setup Jenkins Dynamic slaves creation using jenkins-kubernetes plugin. My jenkins is running outside K8s Cluster. Link: https://github.com/jenkinsci/kubernetes-plugin My jenkins version is 2.60.2 and Kubernetes plugin version is 1.1.2 I followed the steps mention on the readme and successfully setup the connection. My setting looks like: And connection is successful. Then I created a job with pod template : Here starts the problem: 1. When I run this job initially it runs and

Error: “Expected named arguments” in parallel in Jenkins groovy script

核能气质少年 提交于 2019-12-21 06:58:57
问题 I have a Jenkins 2.0 pipeline, with a groovyscript like this: node('nnh561.raijin') { stage 'checkout' build('trunk/checkout') stage 'build' parallel( { build('trunk/build/gfortran') }, { build('trunk/build/ifort') } ) } Each of the individual jobs builds fine, but when I try to run the pipeline, it spits out this error when it hits the parallel step: java.lang.IllegalArgumentException: Expected named arguments but got [org.jenkinsci.plugins.workflow.cps.CpsClosure2@242d0d3a, org.jenkinsci

Jenkinsfile get current tag

本秂侑毒 提交于 2019-12-20 19:39:18
问题 Is there a way to get the current tag ( or null if there is none ) for a job in a Jenkinsfile? The background is that I only want to build some artifacts ( android APKs ) when this commit has a tag. I tried: env.TAG_NAME and binding.variables.get("TAG_NAME") both are always null - even though this ( https://issues.jenkins-ci.org/browse/JENKINS-34520 ) indicates otherwise 回答1: I'd consider returnStdout rather than writing to a file: sh(returnStdout: true, script: "git tag --sort version

Maven installation settings not showing in Jenkins

淺唱寂寞╮ 提交于 2019-12-18 14:00:26
问题 I have just installed Jenkins 2.6 (as a fresh install) but I can't seem to find the Maven installation options. Previously I would just be able to go to Jenkins configuration and in the Maven section there would be an option for MAVEN_HOME and to install Maven automatically. However this doesn't appear to be present for me. I have the Maven integration plugin installed. How can I get these to show? 回答1: Since Jenkins 2.x you can find all the tool configurations (Maven, Ant, Gradle and even

Jenkins Pipeline Fails if Step is Unstable

不想你离开。 提交于 2019-12-18 12:54:08
问题 Currently my pipeline fails (red), when a maven-job is unstable (yellow). node { stage 'Unit/SQL-Tests' parallel ( phase1: { build 'Unit-Tests' }, // maven phase2: { build 'SQL-Tests' } // shell ) stage 'Integration-Tests' build 'Integration-Tests' // maven } In this example the job Unit-Test's result is unstable, but is shown as failed in the pipeline. How can I change the jobs/pipeline/jenkins to have the (1) the pipeline step unstable instead of failed and (2) the pipeline's status

How to invoke a jenkins pipeline A in another jenkins pipeline B

a 夏天 提交于 2019-12-17 17:36:41
问题 I have two Jenkins pipelines, let's say pipeline-A and pipeline-B. I want to invoke pipeline-A in pipeline-B. How can I do this? (pipeline-A is a subset of pipeline-B. Pipeline-A is responsible for doing some routine stuff which can be reused in pipeline-B) I have installed Jenkins 2.41 on my machine. 回答1: A little unclear if you want to invoke another pipeline script or job, so I answer both: Pipeline script The "load" step will execute the other pipeline script. If you have both scripts in

installing node on jenkins 2.0 using the pipeline plugin

落花浮王杯 提交于 2019-12-13 11:58:07
问题 I am running the following docker image jenkinsci/jenkins:2.0-rc-1 to try out jenkins 2.0, and the "pipeline" view. I can't seem to install node. Here's my pipeline script: node { //tool([name: 'node-5.10.1', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation']) sh 'echo $(whoami)' sh 'node -v' } The response when this runs is: [ci] Running shell script + whoami + echo jenkins jenkins [Pipeline] sh [ci] Running shell script + node -v /../durable-3b0b1b07/script.sh: 2: /../durable-3b0b1b07

How to execute a command in a Jenkins 2.0 Pipeline job and then return the stdout

假如想象 提交于 2019-12-13 11:38:37
问题 Is there a better way to run a shell task in a Jenkins 2.0 pipeline and then return the stdout of the command. The only way I can get this to work is to pipe the output of the command to a file and then read the file in to a variable. sh('git config --get remote.origin.url > GIT_URL') def stdout = readFile('GIT_URL').trim() This seems like a really bad way to return the output. I was hoping I could do something like: def stdout = sh('git config --get remote.origin.url').stdout or def exitcode