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

How to pass spinnaker pipeline parameters from Jenkins?

I would like to know if it is possible to pass these 3 parameters from Jenkins job to spinnaker ? Application Git Ref Environment Ansible Git Ref
1
vote
1answer
29 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 |->...
0
votes
1answer
9 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 ...
0
votes
0answers
10 views

How do i notify GitHub pull request for each stage of a parallel Jenkins pipeline?

We have a parallel Jenkins pipeline script which deploy and run three kind of tests in parallel. We have to notify the status of each stage to GitHub pull request. Can anyone help me to get this? def ...
0
votes
2answers
25 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 ...
0
votes
1answer
11 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 ...
0
votes
0answers
12 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 ...
0
votes
0answers
21 views

How tansfer double from jenkinsfile to remote target host via ansible ssh?

I have jenkins ansible and remote host jenkinsfile code def CONSUL_HCL_FILE_CONTEXT(name,port,target_host){ def CONTEXT=""" service { name = '${name}' port = ${port} enable_tag_override = false ...
1
vote
1answer
19 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
0answers
25 views

How to arrange CICD pipelines to support simultaneous deployment of multiple components

I'm coming from a team where for years we've been maintaining a monolithic application with a manual release process that ops puts on bare metal we ship out the door. Now we are doing some cloud ...
0
votes
0answers
23 views

restart from stage is missing from Jenkins declarative pipeline 1.3.1 version

I am having declarative pipeline with 1.3.1 installed on production environment, but restart from stage (feature) is missing. As per documentation this feature is enabled from the version 1.3 i don't ...
1
vote
1answer
16 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
18 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
18 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
1answer
21 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
72 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
36 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
122 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
1answer
48 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
65 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
40 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
61 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
67 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
284 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
467 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
66 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
180 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
328 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
167 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
33 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
78 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
296 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
244 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
516 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
541 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
45 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
37 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
445 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
527 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
113 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
14 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
171 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
49 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
664 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
369 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
394 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
321 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
3k 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
1k 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?