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
24 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
21 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
9 views

Deploy .NET application from Jenkins on Linux to MS Azure Web service

We have .NET application which deployed to Azure Web services. Now is time to create deployment pipeline for it. And want to know what is high level plan how .NET application can be deployed to Azure ...
0
votes
0answers
6 views

jenkins : pipeline to build multiple typescript + react project in the same repo?

Completely new to jenkins and jenkins pipelines and I'm struggling at understanding how to build/package/unit test multiple typescript + react applications all contained in the same repository ...
0
votes
0answers
11 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
17 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
21 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
31 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
15 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
8 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
52 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
11 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
22 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
32 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
134 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
29 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
13 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
50 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
8 views

Does the organizationFolder job dsl config support custom scripts?

https://jenkinsci.github.io/job-dsl-plugin/#path/organizationFolder I have jenkins enterprise and can use custom scripts and marker files: https://docs.cloudbees.com/docs/admin-resources/latest/...
0
votes
0answers
23 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
26 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 ...
0
votes
0answers
13 views

Get Perforce credential info (other than username and password) in Jenkins Pipeline script

I have a Jenkins Pipeline that has been using a Global Perforce Password Credential to perform several P4 commands. Up till now, I need to use and extract the user and password from this credential, ...
3
votes
1answer
39 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 ...
0
votes
1answer
117 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
30 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
24 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
0answers
20 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
10 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
53 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
35 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
10 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
8 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
2answers
47 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
27 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
50 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
1answer
205 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 ...
0
votes
0answers
26 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 ...
1
vote
2answers
114 views

Jenkins - load scripted parameters from a SCM repo

I am using all kind of parameters like "Active Choice Parameter", "Active Choice Reactive Parameter", "Active Choice Reactive Reference Parameter" that have a lot of Groovy code within them. My ...
1
vote
0answers
75 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 "...
0
votes
1answer
33 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. ...
1
vote
1answer
674 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 |->...
1
vote
1answer
167 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 ...
1
vote
1answer
120 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
40 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 ...
1
vote
1answer
20 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 ...
1
vote
0answers
27 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
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 ...
1
vote
1answer
26 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
25 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 ...
1
vote
1answer
31 views

Building Jenkins 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 a CI/CD pipeline, which will connect to GitLab subgroup, ...