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
0answers
8 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" ...
0
votes
1answer
15 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 ...
0
votes
0answers
12 views

How to “killSoftly” a particular Jenkins job?

From SO: My Jenkins build hangs between build and post-build steps. The console output shows there is a 6-minute wait (but I've seen waits of up to one hour): 10:53:26 BUILD FAILED in 1m 7s 10:53:...
1
vote
0answers
22 views

Jenkins release build on master branch fails with maven errors

I am trying to run a release build on the master branch of the repo PlatformObjects/ tracing-zipkin-config. In the Jenkins file when running the command: sh "mvn release:prepare release:perform -...
1
vote
0answers
14 views

Building Jenkin 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 CICD pipeline,which will connect to gitlab subgroup, 1) ...
0
votes
1answer
36 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
35 views

Store data in Jenkins job description

I have a job which I run with a boolean parameter called "BUILD_CLEAN=true", and it defaults to false. I can store this flag in the job ID currentBuild.displayName . Simple enough. But for my purposes ...
0
votes
2answers
52 views

How to add shell script to jenkins freestyle job

I have the below shell script: du -sh /bbhome/shared/data/repositories/* |sort -h |tail -20 | while IFS= read -r line;do DIR=`echo $line | awk '{print$2}'` Rep=`cat $DIR/repository-...
1
vote
2answers
35 views

Jenkins pipeline fails with No such property error

I have Jenkins container (version 2.138.1) with a pipeline which uses the plugins: Job DSL version 1.7.0 Repository Connector version 1.1.3 P4 version 1.8.14 it fails with the below error: 11:23:...
1
vote
1answer
58 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:...
1
vote
1answer
35 views

Is it possible to combine failure stage from groovy with try catch from pipeline?

I have a pipeline with some stages and logic. The only possible debugger is adding try-catch to each stage: stage ("distribution"){ steps{ script{ try{ ...
1
vote
1answer
51 views

Prevent ${PIPELINESTATUS[0]} from being evaluated in Jenkinsfile

Below is a script I am running in the deploy of a docker container. The docker ps -a | grep $APP_CONTAINER_NAME command is returning non-zero when the container was not correctly built/tested, hence ...
0
votes
1answer
40 views

How to save groovy output to pipeline variable

I have the below code in the jenkisn pipeline: stage ("amd_distribution_input_transformation"){ steps{ script{ amd_distribution_input_transformation url: ...
2
votes
2answers
104 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 ...
0
votes
1answer
116 views

How to check if pipeline parameter is empty

I have a pipeline job which includes some parameters: In the pipeline file I have the below code: stage ("create bundle"){ steps{ script{ ...
1
vote
1answer
40 views

How to pass groovy output to pipeline variable

I have the below code in the jenkisn pipeline: stage ("amd_distribution_input_transformation"){ steps{ script{ amd_distribution_input_transformation url: ...
1
vote
2answers
74 views

Jenkins and docker login issue

I am trying to create a Jenkins pipeline that will pull a public image from docker hub and build a Vue.js application inside that container. In my Jenkins server I already have other pipelines that ...
3
votes
1answer
148 views

Jenkins Declarative pipeline: Execute stage conditional on execution of previous stage

I have a Jenkins declarative pipeline with several stages. Some of these stages need to be executed based on whether a previous stage has been executed. In pseudocode: pipeline{ stages{ stage('...
0
votes
2answers
74 views

Issue pushing to ECR using Jenkins

I'm trying to push an image to ECR via a Jenkins pipeline. Currently I have the ECR plugin installed, and a role assigned to my EC2 instance that allows ECR access. I am using correct credentials ...
1
vote
1answer
23 views

Jenkins Cancel (jobs) from Queue by Label

I'm freshman in Jenkins. I would like to cancel jobs by it's own label (hundreds) from my Queue of tasks given to slaves: jenkins.model.Jenkins.getInstance().getQueue() so i then could do: items[i]....
2
votes
2answers
37 views

Jenkins triggered by multiple git repos

I've been looking around to see how to have ~10 different repos all on a git push trigger a single pipeline that does pretty much the same exact thing - build a docker image -except that the different ...
1
vote
1answer
130 views

Jenkins does not seem to be running inside a container

I am getting an error while running the Jenkins file tp build and push the docker image into docker hub . you can reveiw my code github : https://github.com/iakshaykr/webapp.git (using jenkins_pipe ...
2
votes
1answer
88 views

How to mark a step as failed or unstable on timeout, instead of aborting build?

I have a stage in my Jenkins declarative pipeline that looks like: stage('Step Tests') { steps { dir('test') { catchError(catchInterruptions: true, buildResult: 'FAILURE') { ...
0
votes
2answers
225 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 ...
1
vote
1answer
247 views

Problem with Connecting Jenkins to SonarQube

I have a Jenkins pipeline that periodically pull from gitlab and build different repos, build a multi-component platform, run and test it. Now I installed a sonarqube server on the same machine (...
3
votes
0answers
38 views

Is it possible to queue multiple replays of a Jenkins pipeline programmatically? [closed]

We have a parameterized declarative Jenkins pipeline which does tests on a java project with maven. The pipeline goes through a lot of stages to ensure that the code works as expected. However, every ...
1
vote
1answer
34 views

How to deploy SQL Script in DevOps culture and Rollback situation too?

How we can manage database part in DevOps environment/CICD pipeline, Here taking about the SQL Script. For Example any deployment where Insert and Update SQL's, If we setup in CICD pipeline then I ...
0
votes
1answer
167 views

jenkins credentials not used as expected when cloning git repo

I am trying to setup a jenkins pipeline for my IaC code validation, for this I'd like jenkins to clone a gitlab (hosted) repository, for this purpose I setup a credential using username / key type, i ...
0
votes
2answers
343 views

Is there a way to use a Jenkinsfile from a git-submodule in a multibranch pipeline?

Background: The nature of our project's source involves multiple long-living branches, each one has its own Jenkins job (manually created). Multibranch limitation: Unfortunately we do not use a ...
3
votes
1answer
69 views

How to trigger jenkins pipeline only on merge to develop branch from github webhook trigger?

I am having a problem to trigger Jenkins pipeline job based on merge any branches to develop branch only. I also did not find any webhook for merge as like bitbucket. I also tried using pull request ...
0
votes
0answers
12 views

How to provision side containers for jenkins using ECS?

We are successfully using the Jenkins ECS plugin to run many of our builds and tests. However, we have some jobs which require unit tests using mocks, which are often implemented using docker-compose ...
0
votes
2answers
99 views

Jenkins multi branch pipeline configuration for bitbucket [closed]

How to configure multi branch pipeline job for bitbucket ....i have to clone from different branches and build the jobs.... I found multi branch is the option... How to configure for bit bucket
0
votes
1answer
40 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 ...
1
vote
1answer
553 views

How to use comments to trigger rebuilds of Bitbucket pull-requests on Jenkins multi-branch pipeline

I have successfully configured a Jenkins multi-branch pipeline to build my project which is hosted on Bitbucket. I have separate pipeline requirements for the "develop" and "release" branches, and for ...
2
votes
0answers
313 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 ...
0
votes
1answer
247 views

Can “When” like keyword be used in scripted pipeline?

stage('My Conditional Stage') { when { branch 'master' } steps { echo 'Do that only on master branch' } } For Scripted pipeline ; if value of i is 0 then we need skip ...
0
votes
1answer
243 views

Jenkinsfile for monorepo & monobranch

I'm currently working on a Microservice architecture-based project and writing Jenkins Pipeline for it. The project structure is as follows: Web Service (master) Jenkinsfile Service 1/ Jenkinsfile ...
1
vote
1answer
2k 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
1answer
799 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?
0
votes
2answers
41 views

Equivalent of GitLab's “before_script” for Jenkins?

I'm looking for Jenkins' equivalent of the before_script keyword provided by GitLab. So far what I found is the input keyword that you can use before entering the steps part of the stage, but this ...
1
vote
1answer
307 views

Docker fails to mount volume inside Jenkins scripted pipeline

I'm working on a CI Jenkins build with scripted pipeline. From Jenkins on one machine, I'm connecting with already configured Jenkins slave on another machine (M2). I'm able to successfully execute ...
5
votes
3answers
98 views

What is the optimal size of a Jenkins Pipeline Stage?

Should I create single checkout stage or multiple stages like checkout scripts, checkout code, checkout something else? How should I decide on what piece of logic to put into separate stage? Or are ...
1
vote
1answer
350 views

GitHub Payload in Jenkins

I'm using the GitHub plugin with Jenkins, and I'm trying to figure out how I can access the webhook payload. I'm aware that the Generic Webhook Trigger has this ability, as well as the GitHub Pull ...
0
votes
2answers
75 views

Why many companies prefer Jenkins than Aws CodePipeline? [closed]

I have searched few job sites. Many companies are searching engineers who can handle Jenkins as CI platform. I think the Aws CodePipeline is easier than Jenkins. Anyone can advise me, please. Thank ...
0
votes
1answer
812 views

How to write a dynamic declarative pipeline that contains sequential job inside parallel job

I'm trying to write a declarative pipeline code that accepts a map and create a pipeline. I can able to achieve sequential stages or parallel stages but facing problems while making a pipeline that ...
0
votes
1answer
78 views

How to automate the process of patching Jenkins Slave instances in AWS

I've been working on an automated patching solution for some infrastructure in one of our AWS accounts. This AWS happens to host the Jenkins instance we use for CI/CD actions, among other things. ...
1
vote
2answers
903 views

Jenkins pipeline lock resources

I need to run commands on my pipeline during a certain stage, on devices which connected to my Jenkins as slaves. But I want them to run only when another one finished. On the other hand, I want them ...
1
vote
1answer
323 views

Jenkins run build in docker on server (withDockerServer not working)

I am trying to run my build inside a docker; but I don't want the docker to run on the jenkins master but on another server that has docker running. What does work: inside jenkins configure a docker ...
1
vote
2answers
2k views

How to trigger Jenkins Pipeline by push in specific branch in Bitbucket?

I've created Jenkins Pipeline Job, activated "Build when a change is pushed to BitBucket" trigger. I've also specified branches to build. But pipeline is triggered by all branch changes. Also I've ...
1
vote
1answer
5k views

Set environment variables then run script in Jenkins Scripted Pipeline

I am new to Jenkins, Groovy and pipelines. I have created a simple pipeline stage like so: //working build but not setting env variables node('build-01') { stage('Building') { echo "[*] ...