Category "jenkins-pipeline"

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

Jenkinsfile - get all changes between builds

With reference to this question is there a way to get the equivalent information from when using the mult-branch pipeline? Specifically - the list of commits si

How to reuse workspaces between branches with multibranch pipeline on Jenkins?

I've set up multibranch pipeline to track my repo and automatically build and test for all merge requests. It works wonders, however, I noticed that Jenkins cre

How to add a JDBC driver to a Jenkins pipeline?

I want to create a database within a pipeline script to be used by the deployed app. But first I started testing the connection. I got this problem: java.sql.S

trigger jenkins build on tag creation with multibranch pipeline

I've got a stage in my Jenkinsfile for building from a tag matching a tag name filter: stage('Build Release from Tag') { when { tag '*R

Jenkins multibranch pipeline won't prune deleted branches

We're currently having some trouble with the bitbucket branch source plugin used to handle a multibranch test job in one of our Jenkins instances (productive in

file parameter in declarative pipeline

I am developing declarative pipeline and want to use file parameter to read its content, but its not working as expected parameters{ file(fileLocation:

Executing Same Jenkins job by picking fail_skip xml once first execution is over

I am from QA automation and pretty new to jenkins, below is my case Process: I have a jenkins job which picks up a file criticalsuite.xml (testng) and triggers

How do I skip a Jenkins stage after executing some of its steps (like the when directive)?

How do I skip a Jenkins stage partway through its execution? It would be like using when after some steps or in the middle of a step, once the skip condition ha

Artifactory test connection from jenkins gets failed with timed out

I'm using Jenkins Artifactory Plugin and I have this error: Error occured while requesting version information: connect to [myurl..:8081] failed: connection

Jenkins does not recognize command sh?

I've been having a lot of trouble trying to get a Jenkinsfile to work. I've been trying to run this test script: #!/usr/bin/env groovy node { stage('Build

Jenkins shell script returned exit code 1 when the searched string isn't exsist

I'm tring the following at Jenkins in aim to search strings of failures in jobs. This will run on daily basis. def sd = "2020" + "${env.START_DATE}" + "0000"

How to prevent Jenkins SCM polling from triggering a build on branch creation

I have git SCM polling set up in my Jenkins server job. I run the following commands on my local machine and they trigger a Jenkins build: git checkout dev git

How to stop build from executing from the pipeline script?

everyone! Sorry if the question is stupid, I'm just learning how to deal with Jenkins :) For the testing task I'm doing I need to start server, start Tomcat, th

How to get child job logs in parent job on child job failure?

I want to get child job logs in parent job irrespective of if child job passes or fails. Following code returns child jobs logs in parent job only when child jo

How to add a timeout step to Jenkins Pipeline

When you are using a free style project you can set that after 20 minutes the build is aborted if not concluded. How is this possible with a Jenkins Multi Branc