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
6
votes
1answer
2k views

What is the difference between Jenkin's `Replay` and `Rebuild` options?

If you want to re-run a Jenkins job, you can click the Rebuild button which sometimes appears as the Replay button. What is the difference Rebuilding a job versus Replaying it? Why is it that some ...
1
vote
1answer
48 views

CI/CD pipeline with manual advancement?

I am currently learning about CI/CD pipelines for DevOps. I have some practice implementing them in some basic scenarios, but I've recently encountered a slightly more complex scenario and I'm not ...
1
vote
1answer
161 views

How do I use Jenkins to maintain versioning on a Python project?

An independent Jenkins server monitors my develop branch in Team Foundation Server's Git repository and builds a new package when it's updated. The problem I'm having is that it uses the same version, ...
0
votes
1answer
330 views

What is the best approach to deploying to multiple servers using Jenkins?

Trying to figure out the best approach for deploying to multiple servers using Jenkins Blue Ocean pipeline. We will have six servers in development, six in QA, six in Staging, and six in production. ...
17
votes
2answers
23k views

Running a background process in Pipeline job

I am looking for a way to run a java process in background using Jenkins declarative pipeline. Below is the snippet of code stage('Deploy'){ steps{ script{ withEnv(...
9
votes
1answer
310 views

Force Jenkins to reschedule parallel pipeline step as soon as node goes offline

Exactly this. In our environment, we're using GCE preemptible nodes and the Jenkins GCE plugin. As a consequence of this, it's highly likely (even expected) that a node will go away during the course ...
1
vote
0answers
34 views

How can i deploy docker image into kubernetes cluster using Jenkins single job run

Certificate will be generated by a tool Jenkins instance installed. Need to automate certificate renewal process for kubernetes cluster.
1
vote
1answer
332 views

Jenkins Declarative Pipeline: Can Jenkins execute a dynamic list of jobs?

Context: I have a long dynamic list of builds calls that I am currently executing in parallel successfully. Example below. Problem: In some specific moments it is required to run that list of builds ...
3
votes
2answers
5k views

How to trim spaces for parameter value in jenkins pipeline?

I am using jenkins pipeline job with parameters. when i had any trailing spaces in parameter value the job gets failed. is there any way to trim the spaces in pipeline job to avoid build failure?
1
vote
1answer
213 views

Unable to get value of password parameter into another parameter

In Jenkins pipeline parameter say Branches of type Active Choice Reactive Parameter, I've to auto-populate branch names hence I've following command, which I can execute in parameter's Groovy script - ...
1
vote
1answer
42 views

Building Jenkins pipeline with GitLab info

I am new to DevOps world and desperately looking for your help. We have multiple API depositors in GitLab subgroup, I am trying to establish a CI/CD pipeline, which will connect to GitLab subgroup, ...
13
votes
3answers
11k views

One Jenkinsfile or multiple?

So I have a Jenkinsfile defining a build pipeline and then a Jenkins job (not pipeline) with a very simple deployment script for our Docker stacks. Seeing that Jenkinsfiles can become as complex and ...
1
vote
1answer
1k views

How to get logged in username of Jenkins in parameter's Groovy script?

In Jenkins parameter, I'm writing Groovy script and in that script I need to pass Jenkins logged in username NOT user. User and username, could be different Ex - User, that is displayed left to 'log ...
2
votes
1answer
56 views

Docker calls to detect app crashing inside it

Is there a way to know if an app has crashed inside docker using maybe bash script or API call from host container, am implementing CI/CD using Jenkins and will be deploying the built app via ssh to ...
2
votes
0answers
432 views

Passing parameters of extendedChoice type to Jenkins Pipeline via jenkins-cli.jar

I have the following declarative pipeline. It defines checkbox multi-choice parameter: pipeline { agent any options { ansiColor('xterm') } parameters { ...
2
votes
1answer
2k views

Jenkinsfile script to waitUntil a folder is created

With this Jenkinsfile code, I am trying to test A/B folder creation, and also testing if waitUntil works till the folder is created, I expect it to wait for 0 secs as the folder is created before ...
2
votes
1answer
194 views

simulate post step for dynamically generated Jenkins pipeline stages

The following simplified Jenkinsfile dynamically generates sequentially executed stages; however, I cannot create a post step for these dynamically stages, like so: pipeline { agent none ...
3
votes
3answers
6k views

Jenkins pipeline: do “Declarative: Checkout SCM” step only

I'm newbie in Jenkins. I've created pipeine with parameters in Jenkinsfile in git. It works fine. Problem is: when I push new parameters into Jenkinsfile, then press button "Build with Parameters", ...
1
vote
2answers
275 views

Trigger downstream pipeline job for the branch via from upstream freestyle job

I have an upstream freestyle job and a downstream pipeline job. The freestyle job is triggered via a gitHub webhook to run whenever code is pushed to gitHub branch. The freestyle job should capture ...
2
votes
1answer
49 views

Pass environment variables from pipeline job A to pipeline job B

I passed params to pipeline B and set the environment variables from parameters. However, "${params.URL}" is evaluated as null. Pipeline A is declared in Jenkinsfile: pipeline { agent any ...
2
votes
1answer
107 views

How can I retrieve the execution status of parallel triggered child jobs to a pipeline script

I have a pipeline script that executes child jobs in parallel. Say I have 5 data (a,b,c,d,e) that has to be executed on 3 jobs (J1, J2, J3) My pipeline script is in the below format for (int i = 0; ...
4
votes
2answers
4k views

How to check return status of parallel branches in jenkins pipeline

I am running a Jenkins job on multiple slaves. Following is the code structure: def branches = [:] def allNodes = Jenkins.getInstance().getNodes() for (int i =0; i < allNodes.size(); i++) { ...
1
vote
0answers
105 views

How to use superclass and subclass in Jenkins shared library?

I am trying to create super class (common) and a subclass (specific), my plan is to have the common functions defined in super and override it in subclasses as needed, I am trying to write/run my very ...
1
vote
1answer
941 views

Unable to use the class defined in src in vars of jenkins shared library

Here is the folder structure in my shared library repo: $ tree src vars src ├── org    └── common.groovy vars ├── testSrc.groovy src has: $ cat src/org/common.groovy package org.common class ...
1
vote
1answer
227 views

How to add job dependency to gerrit trigger in Jenkins pipeline?

We do have this configuration in our GUI based Jenkins project, trying to convert it to Jenkins pipeline, couldn't find how to add precurse-build as dependent build as shown in red below. I added ...
3
votes
1answer
50 views

It is not allowed to use stages more than once [Jenkins_Declarative_Pipeline]

I am completely new to the jenkins pipeline. I'm trying to create a project with multiple stages but in my Import stage , I want to execute parallel. For each stage in parallel , I have again multiple ...
3
votes
1answer
34 views

Using DevOps pipelines to create distribution bundles of applications

We want to create bundles of our applications in order to distribute to clients etc. An application can have more than one component. Ex: an application can have a spring server and a scheduler so in ...
1
vote
1answer
271 views

Running parallel builds from jenkins pipeline job triggers and waits for same job on other project

I have this test pipeline code, it runs 2 build on different nodes on build_servers as expected. pipeline { agent { label 'myserver' } stages { stage('1') { steps { ...
8
votes
3answers
8k views

Jenkins Pipeline and stash Pull Request Builder not working on PR create/update

Below is the requirement needed to achieve using the Jenkins Pipeline and i am new bee into Jenkins Pipeline. After completing development work and pushing his changes to Bitbucket the user creates a ...
0
votes
2answers
504 views

unable to login using docker registry on jenkins

I have a Jenkinsfile that I need to login to ECR. this is the relevant section script { docker.withRegistry('https://01234.dkr.ecr.ap-southeast-1.amazonaws.com/', 'awsId'){ ...
1
vote
1answer
396 views

How to mark build success when one of the stages is aborted?

I've a pipeline with stages where one of the stage, intermittently takes longer than expectation and hence using timeout to abort it. But if the stage is aborted, build also marked as aborted. ...
1
vote
1answer
1k views

Does active choice reactive parameter support hide fields option?

I have the below pipeline: I want that once I choose in the InstllationType the value 'Recreate', some fields will disappear. is it possible to do it with an active choice parameter? if not, is there ...
1
vote
1answer
1k views

Jenkins pipeline fails on script approval, although it was approved

I have a pipeline which fails on script approval: Scripts not permitted to use method org.jenkinsci.plugins.workflow.support.actions.EnvironmentAction getEnvironment. Administrators can decide ...
1
vote
2answers
748 views

Jenkins - load scripted parameters from a SCM repo

I am using all kind of parameters like "Active Choice Parameter", "Active Choice Reactive Parameter", "Active Choice Reactive Reference Parameter" that have a lot of Groovy code within them. My ...
15
votes
2answers
28k views

How to disable some branches in Multibranch Jenkins Builds?

I have a multibranch job set to run any branch with a Jenkinsfile. I have some options I can think of if I want to remove a branch from the list of jobs running for the multi-branch pipeline. I can ...
0
votes
1answer
119 views

Jenkinsfile handling an expected job failure

I've got two types of failures to account for within a Jenkins job. The job genuinely failed The job failed because of a certain bit of info hasn't been published. Nothing is actually wrong here. ...
2
votes
1answer
4k views

how to checkout only specific folder from git repo((monorepo)) and build

Hey folks I need some help on the jenkinsfile. Below is my usecase This is the strcuture of my GIT repo: root |->app1 | |->jenkinsfile | |->dockerfile1 |->app2 |->...
1
vote
2answers
91 views

How to check minimum code coverage in pull request changes?

I want to force the developers to write unit tests for all new code they wrote. The code is written in python. I want to do it in the Jenkins pipeline. And here is a question. Is there any available ...
1
vote
1answer
34 views

Jenkins file that uses docker-compose gives ambigous error

I'm new to Jenkins and I want to automatize my current workflow a little bit. Right now I push it to the raspberry. Then via SSH I pull the changes, run docker-compose build and docker-compose up ...
1
vote
0answers
170 views

Connection refused when CURLing to docker container from within Jenkins pipeline

I have a situation with a CI Pipeline I'm trying to implement using Jenkins and Docker . Inside my pipeline I want to: download a python uwsgi web app, build it in a docker container, run it, then ...
1
vote
1answer
73 views

Jenkins - Running code in Windows agent but script says we are in Linux

I have the following pipeline (Jenkinsfile): @Library('mylib@master') import com.mylib.* pipeline { agent { label 'WindowsSlaveWS2016' } stages { stage('Demo') { steps ...
0
votes
1answer
623 views

Sonar Quality Gate behavior in Jenkins pipeline is unstable

I have some pipelines in Jenkins, with the SonarQube stage (Version: 6.7.1, build 35068) In some builds it is aborted due to time out: 12:19:01 Sleeping for 3 min 0 sec [Pipeline] timeout 12:22:10 ...
1
vote
1answer
41 views

Pipeline flow get stuck at “Notifying stash” after finishing all stages

All our CI projects are getting stuck in the Notify stash. eventually, it's passing, but we're trying to understand why it takes so much time. example: 17:03:01 Notifying Stash at "https://bitbucket" ...
1
vote
1answer
246 views

Is there a way to set build parameters outside of the pipeline directive?

My build parameters are defined in my jenkinsfiles All builds run on container slaves on google kubernetes engine cluster This means users need to wait for a container to start before anything ...
0
votes
1answer
203 views

Mail logs with Jenkins

I am deploying my software on different OS ( Red hat & suse) and I need to know if my latest version of the software will work. In order to check if the installation works it's enough to check ...
1
vote
1answer
119 views

Sonarqube stage in jenkins pipeline fails with 403 error

have a pipeline job which keeps failing on Sonar Quality Gate stage with the below error: [Bitbucket] Build result notified org.sonarqube.ws.client.HttpException: Error 403 on http://illinXXXX:...
0
votes
2answers
6k views

Jenkins Pipeline - Clean before checkout - git clean -fdx “failed to remove: Directory not empty”

I have my Jenkins build configured to "Clean before Checkout" for its git source: Job Config > Source > git > Behaviours > Clean before checkout This results in Resetting working tree ...
2
votes
2answers
4k views

How to define dynamic parallel stages in a Jenkinsfile?

In declarative pipelines, Jenkins allows the definition of parallel stages. It further allows scripted pipeline general purpose scripts to create and manipulate the artifacts of the declarative ...
1
vote
0answers
134 views

How to get the Jenkins CLI in a Jenkinsfile? [closed]

I would like to call the Jenkins CLI from a Jenkinsfile. I am thinking that I can use the shell directive and call the cli via the client jar. For example sh 'java -jar /path/to/client.jar...' ...
2
votes
0answers
710 views

Rancher Pipeline: How to pass environment variables from one stage to another [closed]

Currently I am trying to move our existing build infrastructure to Rancher with its CICD pipelines. My main question is: Is it possible to pass environment variables from one stage to another? Our ...