Questions tagged [jenkins-pipeline]

For questions specifically about Jenkins 2.0's pipeline architecture. This includes both declarative and scripted pipelines.

Filter by
Sorted by
Tagged with
1 vote
0 answers
12 views

Best practice for building releases with Jenkins multibranch pipeline

We have started moving from Subversion to git (using Bitbucket, to be exact), and I'm unsure how to manage release builds with the multibranch concept. This is how we do it in Subversion: We have one ...
  • 111
0 votes
1 answer
26 views

In jenkins how to restrict users to select first default element with other options in extended choice parameter

I have a jenkins job with multi select extended choice parameter. There are list of elements in a parameter. So, my requirement is I want to allow users to select multiple parameters excluding first ...
1 vote
0 answers
26 views

Complete automatic release process (with versioning) on a multibranch pipeline?

We have projects that once in a while need to be released with all the changes already present in the develop branch. Every time we make a new release, we update the code with the new release version ...
0 votes
1 answer
59 views

Force jenkins job to fail if stage did not run long enough

I am using Jenkins to build an rpm for some custom software. During the build there must be a race condition that only seems to appear when building the RPM, which results in the job finishing ...
  • 103
0 votes
1 answer
29 views

How to understand and resolve Jenkin job failure - Angular 13 app?

I'm new to Jenkins environment. I was asked to upgrade Angular 7.x app which was built 3 to 5 yrs back into Angular 13. Upgrading the Angular app is done. now I want to deploy my UI changes through ...
  • 1
1 vote
2 answers
42 views

Reuse block string without processing it on the fly

I have a block of code that work fine at the moment. But reuse that code is a little ugly. pipeline { agent any stages { stage('Stage 1') { steps { script { ...
0 votes
1 answer
38 views

Transferred 0 file(s) while transferring war file from Jenkins server to remote server

There's a jenkins server where my jenkinswar.war file is present in /var/lib/jenkins/workspace/project2/target/jenkinswar.war I want this file to be transferred to other remote server at /opt/docker ...
  • 1
0 votes
0 answers
626 views

Jenkins checkout GitSCM and git step how does it work internally and why

When I execute my pipeline and I go and see on the actual Jenkins slave, the checked out commit doesn't have latest changes. But the logs and actual files in the workspace on the Jenkins slave running ...
1 vote
0 answers
24 views

Access commit webhook message in Jenkins pipeline

I've got a Jenkins server integrated with a GitHub Organization through a GitHub App and the Jenkins GitHub Branch Source plugin, and it is working fine and triggering builds on commits as intended. ...
1 vote
2 answers
168 views

Rebooting node at end of Jenkins pipeline

I have a pipeline that runs on a dedicated bare metal node for automated performance benchmarking. Using bare metal is necessary due to the nature of the project. Near the end of the pipeline, the ...
  • 111
0 votes
0 answers
22 views

Azure DevOps Pipeline Calling Jenkins just keeps running When Pipeline in Jenkins is completed

We are calling a Jenkins Pipeline from Azure DevOps. Our Jenkins server is behind firewall and installed on Linux VM on Azure Cloud. To Call the pipeline from Azure DevOps we placed a self hosted ...
0 votes
0 answers
19 views

"Lazy-building" of libraries with Jenkins

I have a project with multiple "products" which all use a common shared library. This shared library is a very great proportion of the compilation effort, so it would be good if we could ...
0 votes
1 answer
44 views

Understanding Jenkins plugins and agent

I was trying to understand jenkins agents. This page asks to first create jenkins docker agent. But it doesnt say where to execute these steps? Q1. Should we be executing these steps on node or a ...
  • 121
0 votes
1 answer
2k views

Read and parse json file from workspace on slave node

I have a Jenkins job which runs on a slave node on another machine, both master and slave run on windows. The slave node is being run as a windows service. I am unable to read a json file from ...
0 votes
1 answer
648 views

Create a folder in slave node using Jenkins pipeline groovy script

I have a Jenkins job which runs on a slave node on another machine, both master and slave run on windows. The slave node is being run as a windows service. The main repository has git submodule ...
2 votes
0 answers
42 views

Jenkins declarative pipeline with mvn, releases and versioned artifactory

We have a requirement to support human defined versions (not auto generated) for patch releases. I'm trying to figure out a way to do this in Jenkins. We have: BitBucket, Jenkins, Nexus/JFrog (either)...
  • 121
0 votes
0 answers
105 views

How to run two views in Jenkins and run multi Jobs parallelly?

How to add the views in pipeline script to run the views parallelly. I have different views like EX: view name: Project A --> Project A consists of different jobs like job1, job2,...etc view name: ...
  • 1
0 votes
1 answer
284 views

How to use the Shared Workspace plugin in a Jenkins pipeline?

I want to use the Shared Workspace plugin, so I set up the following key/value pair in my Manage Jenkins -> Configure System -> Workspace Sharing Name: sandbox-workspace Repository URL: git@...
  • 295
1 vote
0 answers
63 views

Add Cache-control: no-cache,no-store metadata to object uploaded via S3 Publisher plugin in Jenkins

So i have a jenkins job that builds a project and then uploads specific files to an S3 bucket. I've set up the S3 Publisher plugin shown in the attached image, but the metadata is still not being ...
0 votes
0 answers
12 views

Sonarcube from JenkinsFile not able to get the customised pom.xml path to run sonar:sonar mvn command

I want to run the SonarCube report from my project from jenkinsfile. I am using below stage to run sonarcube report. stage('SonarQube Code QualityCheck') { steps { bat '...
  • 101
0 votes
0 answers
58 views

Access denied while pushing image to GCR via a Jenkins job

I'm running into a strange issue where my Jenkins job fails with the following error while pushing the docker images to GCR. Although if I SSH into that particular Jenkins worker node and run the step ...
  • 283
0 votes
0 answers
69 views

start downstream jenkins job at specific commit

We're using declarative pipeline files to trigger jobs inside source control. I have one pipeline for testing, and another pipeline for deploying. I know if testing passes I can use buildJob to start ...
  • 101
2 votes
2 answers
789 views

Shared Jenkinsfile for multiple pipelines (separate source repositories)

I'd like to write one Jenkinsfile to be shared between a number (~50) of pipelines/jobs, where each job handles the creation of a library from a specific source (git) repository. Currently I have one ...
0 votes
0 answers
159 views

Mention users on Slack for failing builds

Scenario: I have jobs with Jenkinsfiles where I can get the env.BUILD_USER_ID exposed by a Jenkins plugin. So, what I`m planning to do is associating this variable content to the Slack user ID value, ...
0 votes
1 answer
419 views

Can one run a docker container with systemd from a jenkins pipeline?

I have been unsuccessful running a docker container with systemd from a jenkins pipeline without getting the following error message: ERROR: The container started but didn't run the expected command. ...
0 votes
2 answers
486 views

What is the best practice for a multibranch pipeline configuration?

I'm messing around with a multibranch pipeline in jenkins. Currently we have zero pipelines in production and everything is using freestyle jobs which is very sloppy. I have my own multibranch ...
0 votes
1 answer
104 views

Execute python file existing inside image with Jenkins

I have an Image A, which has a python file "main.py". I want to know how I can use Jenkins to run that file from a different pipeline. I want to use Jenkins to go inside that image and then ...
0 votes
1 answer
295 views

Checkout shared library with tag with legacySCm

So trying to checkout shared library by tag. This works perfectly with moderSCM, but for reasons we need to use other way (legacySCM); def lib = library identifier: 'jenkins-shared-library@41', ...
  • 101
0 votes
2 answers
67 views

Recommended starting guide on CICD

I'm new to the community, and I looked around a bit but didn't find a good point to start from. I have a specific problem I want to solve, but while trying to think of a solution I realized I need a ...
0 votes
0 answers
29 views

Jenkins - How to reserve a resource for a branch in a multibranch pipeline

I have a small group of developers working on tickets from our customers. What we need is to be able to allow fast testing by the users to validate de changes done in their tickets by the developers. ...
1 vote
1 answer
331 views

Run multiple (dynamic list) other jobs from a single job

I have 30+ jobs in jenkins that deploy code. For any release, it could be 1 to 30 of those jobs that need to be run. Each job is standalone and deploys its piece independently. For simplicity let's ...
1 vote
0 answers
461 views

net.sf.json.JSONException: Invalid JSON String error on jenkins

Warning: API call to create metrics set failed: [Pipeline] echo net.sf.json.JSONException: Invalid JSON String at net.sf.json.JSONSerializer.toJSON(JSONSerializer.java:143) at net.sf.json....
1 vote
1 answer
224 views

Why does Jenkins' Stage View not show my jobs as ending?

I am using Jenkins' remote API (XML & JSON) to submit Jobs, run them & retrieve the logs. When observing the jobs in Stage View, I noticed that (following a change in my "submission ...
  • 113
2 votes
1 answer
675 views

Re-running a pipeline job if failed

I've heard about the Naginator plugin, but unfortunately it's only for freestyle job type. Is there any solution for pipeline jobs to be triggered if they failed? I thought about creating a command in ...
1 vote
0 answers
73 views

Jenkin "unable to find valid certification path to requested target" getting error while installing plugin

We are trying to set up jenkins. When we trying to install plugin getting the below error. We also tried to import the trusted certificate into the JVM directly still getting same error. sun.security....
1 vote
1 answer
142 views

Package installed using Dockerfile not available on Jenkins pipeline stage

I'm having sort of a weird problem with my Jenkins pipeline. I've defined a Dockerfile which installs some tools I need for my CI/CD pipeline, such as node, npm, sfdx, and sfpowerkit (a plugin for ...
0 votes
1 answer
238 views

Jenkins Pipeline job does not use Squid Proxy

I have configured a Squid Proxy and it seems to be working when I add below Env variables to the /home/user/.bashrc file to a client machine. Note: SSL Bump is configured, Self Signed Cert is added to ...
2 votes
2 answers
1k views

Send command to docker image while start in Jenkins file

In scripted Jenkinsfile if I need to send a command to Docker image, I can do like this: docker.image('mysql --default-authentication-plugin=mysql_native_password') How can I do the same in ...
  • 31
1 vote
1 answer
334 views

Jenkins Pipeline - conditional execution with branch and 1 other parameter (manual)

We are deploying our application using Jenkins pipeline like this - pipeline { agent any stages { stage('Build For Production') { when { branch 'development' } steps { ...
1 vote
2 answers
192 views

Jenkins pipeline retry option triggers two builds at a time, one in execution state other in pending state for a single click

For example I have clicked on retry option at build number 2 in Jenkins pipeline view, where as build number 3 gets start and build number 4 also gets start and awaits at pending state. Why the build ...
  • 11
1 vote
0 answers
38 views

Application deployed in tomcat cannot be started through Jenkins pipeline [closed]

I've deployed an application deployed in tomcat and want to restart and hence stop it first and then start it with following code - def startServer() { withEnv(['JENKINS_NODE_COOKIE=dontkill']) { ...
  • 153
-1 votes
1 answer
657 views

How to get ConsoleFull Output,changeLog of upstream job along with downstream jobs console full output and changeLog in jenkins pipeline jobs!

Lets say we have Jobs A , B , C ,D and E. Job A triggers Job B ; Job B triggers Job C; Job C triggers Job D;, Job D triggers Job E; When one of the child job fails for example: Job c fails then email ...
  • 1
1 vote
0 answers
23 views

Our code is behind a firewall and we don't want to put source code in cloud. Are there any good CI/CD using local agents for Azure/Github actions

Our source code is in our servers and we don't have approval to put it in cloud. We don't have a seamless CI/CD. Can we use Azure pipeline agents or any local agents to build our code and only export ...
2 votes
1 answer
246 views

What are ways to structure a webhook-triggered job that triggers a human-triggerable job?

I hope it's okay to ask for recommendations here. I'm very new to devops, and am trying to get into the headspace of involved technologies and workflows. I've created a webhook in my Bitbucket project ...
1 vote
1 answer
5k views

Why does Jenkins Pipeline script returnStatus value not match status examined in shell?

This is my little newbie Groovy script, trying to cobble together a very beginner understanding of Jenkins Pipelines: node { stage("hello") { def var = "val" echo "${var}&...
0 votes
1 answer
754 views

Where is Jenkins Pipeline script stored and can I control it?

Several tutorials I'm referencing to learn about Jenkins Pipeline scripting guide one to create Jenkins Pipeline jobs as follows: Click New Item in the left pane. Click Pipeline and enter an item ...
0 votes
1 answer
326 views

Why are variables with fixed values not visible in Jenkins Pipeline stage?

I'm new to DevOps, and am cobbling together a beginner understanding from lots of reading, YouTube videos, and online examples. I've had initial success adapting this helpful tutorial. I.e. in my ...
0 votes
1 answer
159 views

Checking Jenkins build status from only one pipeline and avoid from other pipeline pointing to same gitlab repo in PR build

Hi I am having two jenkins pipeline pointing to same git repo one pipeline is named as mainpipeline and other is sit pipeline. Before sit pipeline our git PR build is checking the build status from ...
0 votes
1 answer
107 views

Jenkinsfile credential as paramter unable to use it

I am trying to use the credentials parameter for a git clone. But i am getting the error that the variables are not found Param definition credentials (credentialType: 'Username with password', ...
  • 123
1 vote
1 answer
341 views

Jenkinsfile update using version control

I've a Jenkinsfile in the master branch of the repository with following code pipeline { agent any stages { stage('A') { steps { sh 'echo "Step A"'...
  • 283

1
2 3 4 5 6