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
0answers
16 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{ ...
2
votes
0answers
22 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
1answer
40 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. ...
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 ...
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 ...
0
votes
0answers
30 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
20 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: ...
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
1answer
48 views

How to handle services when the developers provide incorrectly in k8s

I provided the script to provision a new feature environment inside k8s it will create all the configs required, namespaces, resources and whatever... in my script, I described this param: parameters {...
3
votes
1answer
262 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 ...
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 ...
1
vote
1answer
39 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
27 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
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
1answer
37 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. ...
0
votes
1answer
87 views

Jenkins Not pulling the latest commit into master or slave

I have a Jenkins pipeline where after every build I change a file(increase build version in a property file) and checkin back to the git repository. After a build, I commit some differnt code change ...
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 ...
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
1answer
88 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 ...
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
154 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="...
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 - ...
1
vote
1answer
286 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 ...
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 { ...
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....
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 ...
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": "...
2
votes
1answer
60 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 ...
2
votes
1answer
40 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 ...
0
votes
1answer
894 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....
2
votes
1answer
42 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; ...
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
1answer
242 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 ...
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 ...
1
vote
1answer
80 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
41 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 ...
1
vote
1answer
1k 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 ...
3
votes
1answer
32 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
35 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 { ...
0
votes
1answer
87 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
44 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
2answers
177 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
2answers
82 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 ...
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 ...
1
vote
1answer
142 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. ...
0
votes
0answers
73 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
101 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?
1
vote
1answer
498 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
2 3 4 5