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
2answers
586 views

Jenkins trigger build if shared library changes

I have Jenkins Pipeline job define in my git repo as. // File: deployment/jenkinsfiles/staging/Merge @Library("my_shared_lib") _ import com.company.myteam.Constants pipeline { agent { label "...
-1
votes
0answers
228 views

How to configure Bitbucket Build Status Notifier Jenkins plugin to connect to BitBucket Cloud for Jenkins Pipeline projects

I would like to know how to configure Bitbucket Build Status Notifier Jenkins plugin to connect to BitBucket Cloud for Jenkins Pipeline projects. Basic instructions are here, on a plugin homepage: ...
0
votes
0answers
37 views

Get Jenkins build numbers from another job into active choices parameter

Here's what I'm trying: I have a build job and a deployment job. I want to trigger deployments using the build job's build numbers. I'm having trouble incorporating this into a Jenkins pipeline. So ...
2
votes
1answer
21 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
votes
0answers
8 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 ...
0
votes
0answers
14 views

Can a Jenkins Pipeline project be configured with a config-driven pipeline?

I've added the Config-Driven Pipeline Jenkins plugin, and -- as advertised -- it has enabled a by Config-Driven Pipeline option to the Build Configuration section of Multibranch Pipeline projects. Is ...
1
vote
0answers
14 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 ...
0
votes
1answer
129 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
1answer
14 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
1answer
19 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
1answer
29 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
1answer
32 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', ...
0
votes
0answers
12 views

Docker run command inside jenkins pipeline produces error

Background I have a Jenkins pipeline that I use for building my application. Actual building of software is done using a container. I just mount the source code to container and run container with a ...
0
votes
1answer
309 views

Using Jenkins declarative when conditions in scripted pipelines

Jenkins declarative pipelines offer very convenient when directive with conditions like changeset. Is is possible the this changeset and other when conditions in a scripted pipeline?
23
votes
3answers
30k views

How to build a complex parallel Jenkins pipeline?

I've been interested in converting our bespoke Jenkins integrations into a pipeline. However, I can't seem to figure out how to do it. Can anyone help me with the Jenkins script that could do the ...
0
votes
2answers
66 views

Jenkins: Re-use repository with reference option and do changes on it

I would like to setup a Jenkins cluster where the slaves are building an Android ROM with some parameters like branch (e.g. lineage-16.0) and some optional patches. The whole repository will consume ...
0
votes
0answers
22 views

Parametrized remote trigger with multiline string Jenkins

I have a Jenkins job which triggers a remote job. Both the jobs have a multiline string as paramter. I am not able to pass the parameter to the remote job. Only the first line of my input string is ...
0
votes
1answer
42 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"'...
0
votes
0answers
31 views

Can you limit the scope of the “post” block in Jenkins to the stage result status?

I am trying to execute a script based on the result of a particular stage in a Jenkins declarative pipeline, but the post block seems to be dependent on the status of the entire pipeline. Any way of ...
1
vote
1answer
61 views

Jenkins downstream pipeline jobs not always triggered as expected

I have three separate Multibranch pipeline jobs set up on Jenkins, which I want to be called sequentially as downstream-jobs. Please note that, all these 3 jobs have separate git repositories! Each ...
0
votes
1answer
30 views

Auto create Jenkins jobs for branches and pull request via declarative code in scm

I am looking to auto create jobs in jenkins upon pull request , branches, master push etc similar to what we do in Gitlab. My SCM is butbucket here. I have so far setup docker based agent integration ...
2
votes
1answer
519 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
1answer
56 views

Jenkins Docker - Make changes to gitconfig

I have a self-hosted Gitea organization, and the way to access the repos requires some "secret" extraheader in .gitconfig. (2FA is also enabled) When I look at Jenkins "Configure System&...
1
vote
0answers
31 views

Parallel execution of same job with different configuration- pipeline jenkinsfile script path is updated incorrect

I have a jenkins job A and i have 5 tests (each triggering job A with updation of different jenkinsfile script path as Before Each test) executing in parallel Test1 with pipeline-jenkinfile-1 Test2 ...
0
votes
0answers
27 views

Why maven build slows in docker container when local maven repo mapped to container's /usr/share/?

We run Jenkins pipeline on docker container. During the run, we mount host's .m2 to container's with - -v $HOME/.m2:/usr/share/.m2 When host's .m2 mounted into container's /usr/share/.m2 maven build ...
0
votes
1answer
568 views

Jenkins transferring file using publish over SSH plugin but file not show in remote development server

I have a running a jenkins job by jenkins pipeline. i wants to send an environmental (.env) file from my local system to my server using Publish Over SSH Plugin. Here is my jenkins snippet: stage('...
0
votes
1answer
264 views

How can I add a when clause for a specific upstream trigger in a Jenkins declarative pipeline?

I have a job defined as a declarative pipeline that gets triggered by a number of different upstream jobs. Depending on which upstream job triggered my job, I don't necessarily need to run all of the ...
2
votes
2answers
9k views

Jenkins API call (or Groovy builtin) that returns list of all currently running builds of jobs

There's plenty of questions asking how to return a list of all jobs on your Jenkins instance, or even to get a list of which jobs are currently running, but I have a more specific use-case. I need ...
0
votes
1answer
241 views

Add stages to Jenkins declarative pipeline through shared library

Is there a way to write a stage in a Jenkins shared library so that it can be added to declarative pipelines? Background For many projects, I need to run tests on multiple different servers. My ...
13
votes
3answers
57k views

How to define variable in Jenkins declarative pipeline?

I defined variable in declarative Jenkins pipeline script but having issues with simple variable declaration. Here is my script: pipeline { agent none stages { stage("first") { ...
0
votes
0answers
69 views

How to use jenkins build parameter in web ui?

I have a ready jenkins build parameters , I want to use/link the same in webpage UI (that to be created). Need help on - what are various possible way to achieve this ? any document , link would be ...
1
vote
1answer
1k views

Skip stages in Jenkins pipeline

I am using a scripted pipeline where I am required to skip some stages conditionally.Is there a way to show skipped stages on Jenkins UI other than importing org.jenkinsci.plugins.pipeline....
1
vote
1answer
39 views

Jenkins: Access job/plugin configuration values inside pipeline

I am trying the access the values set on a job's configuration page from within my pipeline. These values are not made available as params, nor are they injected as envvars. Setup Jenkins, v2.263.1 ...
0
votes
2answers
143 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
380 views

Jenkins declarative pipeline Warning: JENKINS-41339 probably bogus PATH

I am struggling with this issue inside my declarative pipeline. I am trying to use python's docker image as my agent and run some scripts and I am receiving warning: Warning: JENKINS-41339 probably ...
1
vote
1answer
46 views

how to update .env file in production while Jenkins deployment

how to update the .env file in production while Jenkins deployment? we have not committed the .env file in git for security reasons.
0
votes
1answer
16 views

jenkins build overview page not showing stages in webui

I'm using the image: jenkinsci/blueocean from Dockerhub The build overview page isn't showing the stages of a build. i.e. the square boxes that represent the stages are not appearing. Am I missing a ...
0
votes
0answers
40 views

Jenkins Declarative Pipeline not running

I have just upgraded the jenkins version and wrote my first Jenkins declarative plugin. Following is the pipeline definition pipeline { agent any stages{ stage('Welcome'){ ...
2
votes
1answer
748 views

branch specific jenkins pipeline trigger

I am trying to trigger a jenkins pipeline job only when a pull request has been approved & merged to a specific github branch in our CI/CD implementation. currently whenever i merge a PR to ...
0
votes
1answer
228 views

How can I check if there is a new build the same jenkins pipeline

I have a github multibranch pipeline, in declarative format. It is configured to trigger on pushes to pull request branches (ie, branches which are included in pull requests to a target branch, say ...
78
votes
6answers
170k views

Cleanest way to prematurely exit a Jenkins Pipeline job as a success?

I have a job that will create files, unless one of the values being fed to it matches an older value. What's the cleanest way in Jenkins to abort or exit the job, without it being FAILED? It exiting ...
2
votes
2answers
1k 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 ...
2
votes
1answer
51 views

Pass information between Jenkins Job builds

Please excuse my non-fluent terminology.. There is a Jenkins server, master and a few slaves, there is a pipeline job.. let's call it playground I run the job once, I want to save some data somewhere. ...
2
votes
3answers
3k 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 ...
2
votes
2answers
9k views

How to execute an ansible playbook using a jenkins pipeline script?

We developed declarative pipeline code to execute an Ansible playbook. We tested the playbook from CLI and it is working properly. My playbook actually performs some shell commands on remote server. ...
0
votes
0answers
8 views

Run check on a sample of CI events

Suppose we have a very expensive test in terms of time. This may be some kind of deep analysis or performance test. I would like to run this on a sample of CI events in a Jenkins pipeline, say 20% of ...
1
vote
0answers
20 views

How can I configure Jenkins pull request builder to run tests on Github dependabot PRs

Our Github project repository is configured to receive security PRs from dependabot, and we get them periodically. We are using Jenkins with Build Triggers so that when a user comments /test in a PR ...
0
votes
0answers
680 views

how to check if a pipeline variable is empty

Team, I have a Jenkins job that runs every 5minutes and sends a slack notify to channel. but I want to not send slack if there is 0 returned in count variable. how to achieve this? like with if else ...
1
vote
1answer
870 views

Extended Choice Parameter: How to load params dynamically from any file for jenkins build job

Though below code works fine individually: extendedChoice description: '', multiSelectDelimiter: ',', name: 'Capablities', quoteValue: false, saveJSONParameterToFile: false, type: 'PT_CHECKBOX',value: ...
0
votes
1answer
3k views

Jenkins Plugin:Extended Choice Parameter from JSON file

Extended Choice Parameter plugin query: How to load params dynamically from a JSON file for jenkins build job. Here is my jenkins script to add normal parameters and Extended Choice parameters as well....

1
2 3 4 5