Questions tagged [jenkins-pipeline]

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

31 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
25 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 ...
2
votes
2answers
6k 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. ...
1
vote
0answers
15 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 ...
1
vote
0answers
12 views

Allow specific AWS permissions(Lambda, S3) / roles to specific Jenkins Jobs within same AWS account

We have one AWS account in which an Ec2 instance is running where Jenkins is installed, and we have attached an IAM role to it, with s3 access permission. We have Jenkins jobs which needed aws ...
1
vote
0answers
30 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
0answers
59 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 { ...
1
vote
0answers
37 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
0answers
206 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
vote
0answers
65 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
43 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 - ...
0
votes
0answers
14 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 ...
0
votes
1answer
4 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 ...
0
votes
0answers
17 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'){ steps{ ...
0
votes
0answers
5 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 ...
0
votes
0answers
31 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 ...
0
votes
0answers
17 views

Jenkins : How to get the name of each “stage” within a parallel block?

If I have : parallel( label1:{ <do something> }, label2:{ <do something else> } ) How could I get the "stage" name (i.e. label1 or label2) in each of them ? For sure, I don't ...
0
votes
0answers
15 views

Jenkins pipeline: some folders in workspace are owned by root

In the pipeline job, the Jenkinsfile is provided from SCM, github: However it's causing permission issue. Then job runs on an aws ec2 instance, so the first step is to pull from github. I then ssh ...
0
votes
0answers
12 views

Jenkins job build is getting failed while concurrent builds is happening in job with fatal:not a git repository

When I'm deploying in jenkins job the build will run fine but same time if I deploy again in same job like concurrent build then I'm getting this error "fatal: not a git repository(or any of the ...
0
votes
0answers
14 views

How to enable timeout in pipeline based on a condition?

I have a Jenkins pipeline with the following stage - stage('Test') { options { timeout(time: 5, unit: 'MINUTES') } steps { script { ...
0
votes
0answers
163 views

How to edit xml files through Jenkins pipeline?

I've to update xml file as a part of pipeline. From following, I've to replace value from true to false <bean id="SecurityFilter" class="xxx"> <property name="...
0
votes
0answers
23 views

Avoid RejectedAccessException when adding key,val to environment using env[key]=val in Jenkins Declarative pipeline

Adding key,val to environment using below: pipeline { stages { stage("Shallow clone or fetch"){ steps { script { readProperties(file: "f....
0
votes
0answers
12 views

Search in json file nested value

There is a file with such a data structure. How can I find id with groovy script using that matches the search object = prod OR object = prod. And return matches id in result. [ { "id": "...
0
votes
0answers
36 views

Is there a way to monitor stuck pipeline in jenkins

We want to develop a job, which will indicate on selected Jenkins server stuck pipelines. I'm aware there is a Jenkins plugin for flows, but it doesn't support pipeline: build-timeout I need a way to ...
0
votes
1answer
90 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
0answers
48 views

How to create an object from a Jenkins Shared Library sub-class

I'm reworking our shared libraries and trying to take a more OOP approach. I'm able to create a class and instantiate an object from that class, but I'm not able to do the same with a subclass. Here ...
0
votes
0answers
11 views

Jenkins pipeline does not proceed even if Selenium execution finishes

I have a pipeline with stage for Selenium execution where execution of Selenium tests takes around 5 hours. In 'Selenium Execution' stage, I've code to execute Selenium tests then taking backup of ...
0
votes
0answers
10 views

How do I see what Jenkins Enterprise team a user is in from inside a pipeline?

I can see who the current user is like this: def build = currentBuild.rawBuild def cause = build.getCause(hudson.model.Cause.UserIdCause.class) def user = cause?.getUserName() But I use Jenkins ...
0
votes
0answers
74 views

How to publish compiled angular files inside a jar in JFrog artifactory

We are copying multiple angular project build files inside the UI folder in a jar. Below steps are performed by Jenkins at the build creation to achieve this: Clone multiple angular repositories. Run ...
0
votes
1answer
104 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?
0
votes
0answers
40 views

Geting and put all secret in an env file on jenkins from Hashicorp vault

Currently we are building a jenkins deployment pipeline. On those build, for secret management we are using HashiCorp Vault. For getting secrets we use the hashicorp-vault-plugin. The problem is we ...
0
votes
1answer
27 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 ...