Category "jenkins-pipeline"

Discard old build in multi-branch pipeline job, doesn't really delete builds from server

I have multi-branch pipeline job in Jenkins: http://illinXXXX:XXXX/job/OC/configure and I checked the option for Discard old builds as below: I would have

Jenkins pipeline checking out to new workspace when previous build has been aborted

So I'm running into a specific issue, I have a Jenkins Declarative Pipeline (from an SVN hosted Jenkinsfile) that is configured to not run concurrent builds and

Jenkins Transitive Dependency between Global Pipeline Libraries

My setup includes 2 Jenkins pipeline libraries, e.g. lib_generic and lib_specialized, where the second one depends on the first one (will call classes and globa

Zip Command not found in Jenkins

I am trying to zip a directory in a Jenkins pipeline, my code is similar to this stages { stage('ZIP') { steps {

How to use the Jenkins MSBuild plug-in in a Jenkinsfile?

I have Jenkins v2.60.3 with the MSBuild Plugin v1.27 installed on Windows. I have configured the path to my msbuild.exe in Jenkins' Global Tool Configuration.

Trigger parameterised maven release with Curl

Using following command to perform maven release: curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -u user:jenkinscrumb --data-urlencode json=

Preventing default checkout in shared Jenkinsfile

I have a number of multi-branch pipeline jobs in Jenkins on Windows, each of which uses a standard procedural Jenkinsfile which contains various methods for run

Keep workspace when switching stages in combination with agent none

I have a Jenkins pipeline where I want to first build my project (Stage A) and trigger an asynchronous long running external test process with the built artifac

How to use source command within Jenkins pipeline script

I recently rewrite bash execution command into Jenkins pipeline. The old code is like ... source environment.sh //Build //Test ... Now I use pipeline script

Abort Jenkins pipeline (workflow) build after timeout

Whenever a build gets stuck of fails somewhere the timeout kicks in but the build is not aborted and it is stuck running forever until you cancel the build, go

How to retrieve current workspace using Jenkins Pipeline Groovy script?

I am trying to get the current workspace of my Jenkins build using a Groovy pipeline script: node('master') { // PULL IN ENVIRONMENT VARIABLES // Jenki

How to use a FileParameterValue in a jenkins 2 pipeline

How can a file from the current project workspace be passed as a parameter to another project. e.g. something like: build job: 'otherproject', parameters: [[$

How to define a variable in post section of pipeline?

I want to use some common value across different conditions in post section of pipeline hence I tried following - 1. post { script { def va

Get username logged in Jenkins from Jenkins Workflow (Pipeline) Plugin

I am using the Pipeline plugin in Jenkins by Clouldbees (the name was Workflow plugin before), I am trying to get the user name in the Groovy script but I am no

Jenkinsfile Pipeline DSL: How to Show Multi-Columns in Jobs dashboard GUI - For all Dynamically created stages - When within PIPELINE section

Jenkins 2.89.4 rolling I saw almost all stackoverflow posts which show how we can successfully run parallel steps/stages (using list/maps etc) --OR hardcoding

Required context class hudson.FilePath is missing Perhaps you forgot to surround the code with a step that provides this, such as: node

When i load another groovy file in Jenkinsfile it show me following error. "Required context class hudson.FilePath is missing Perhaps you forgot to surround th

Reuse object/property in different stages of a declerative pipeline in Jenkins

We create a new maven build: def rtMaven = Artifactory.newMavenBuild() Now we want to reuse this rtMaven in a different stage than the current one; like in t

Run maven deploy without re-running the entire build

I'm working on a multi-branch pipeline for a maven project. I'm trying to follow what the Jenkins docs keep referring to as the standard CI steps, Build, Test,

Jenkinsfile Declarative Pipeline defining dynamic env vars

I'm new to Jenkins pipeline; I'm defining a declarative syntax pipeline and I don't know if I can solve my problem, because I didn't find a solution. In this e

Jenkins groovy - How to retrieve tag from latest commit?

To fetch the latest commit from branchName, we run below code: treeMapData = git(branch: branchName, credentialsId: credential, url: "${gitLabServer}/${project