Top "Jenkins-pipeline" questions

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

Show a Jenkins pipeline stage as failed without failing the whole job

Here's the code I'm playing with node { stage 'build' echo 'build' stage 'tests' echo 'tests' stage 'end-to-end-tests' def e2e = …

jenkins groovy jenkins-workflow jenkins-pipeline
How do you load a groovy file and execute it

I have a jenkinsfile dropped into the root of my project and would like to pull in a groovy file …

jenkins groovy jenkins-pipeline
How do I make Jenkins 2.0 execute a sh command in the same directory as the checkout?

Here's my Jenkins 2.x pipeline: node ('master'){ stage 'Checkout' checkout scm stage "Build Pex" sh('build.sh') } When I run …

shell jenkins groovy jenkins-pipeline
Abort current build from pipeline in Jenkins

I have a Jenkins pipeline which has multiple stages, for example: node("nodename") { stage("Checkout") { git .... } stage("Check Preconditions") { ... if(!…

jenkins jenkins-pipeline
Using a Jenkins pipeline to checkout multiple git repos into same job

I'm using the Jenkins Multiple SCM plugin to check out three git repositories into three sub directories in my Jenkins …

git jenkins jenkins-pipeline
jenkins pipeline: agent vs node?

What is the difference between an agent and a node in a jenkins pipeline? I've found those definitions: node: Most …

jenkins jenkins-pipeline
Failing a build in Jenkinsfile

Under certain conditions I want to fail the build. How do I do that? I tried: throw RuntimeException("Build failed …

jenkins groovy jenkins-pipeline
Jenkins Multibranch pipeline: What is the branch name variable?

I'm new to the Jenkins Pipeline plugin, and especially new to the multibranch pipeline plugin. In a standard build I …

jenkins jenkins-plugins jenkins-pipeline
Access a Groovy variable from within shell step in Jenkins pipeline

Using the Pipeline plugin in Jenkins 2.x, how can I access a Groovy variable that is defined somewhere at stage- …

jenkins jenkins-pipeline
How to use Jenkins parameters in a shell script

I want to use the parameters that we define in the Jenkins job as arguments to the shell commands in …

shell jenkins jenkins-pipeline jenkins-cli