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
0 answers
6 views

Post jenkins console output to slack or email

for freestyle job there is a method for console output to share with slack or jenkins for pipeline we don't have one. help here
playwithcode's user avatar
0 votes
0 answers
6 views

How to work with krew in Jenkins?

I'm new to jenkins . I have written a jenkins pipeline to create blockchain network using HLF Operator. I've installed kubectl on the vm and used it as node in jenkins. The kubectl commands and other ...
Haaris Khatri's user avatar
0 votes
1 answer
24 views

Execute Kubernetes commands with Jenkins

I am a beginner to devops and right now I'm learning jenkins. I have a kind cluster on my local machine and jenkins running inside a docker container at http://localhost:8000. I wish to execute the ...
Haaris Khatri's user avatar
0 votes
0 answers
36 views

Jenkins identity file not accessible

I am new to Jenkins and DevOps in general. I am trying to learn to deploy war files onto Tomcat 9.xx running on an amazon EC2 instance. Tomcat is accessible via the browser I have the following ...
Spindoctor's user avatar
0 votes
1 answer
138 views

How to modify a Jenkins pipeline job's property programmatically?

We set up a Jenkins job in multiple folders that has the following "Choice Parameter" property. How can I modify the property programmatically to add more choices? For example, I want to ...
Chris F's user avatar
  • 411
0 votes
0 answers
52 views

Most suitable pipeline storage option for Jenkins/Kubernetes CI setup

I have a quite complicated setup, considering that it's first time setting up such environment. I'm looking for some guidance on how to set it up properly. I've got 7 servers, 2x28 CPU (for 112 ...
Thurisaz's user avatar
0 votes
1 answer
104 views

In Jenkins, how can I disable "Discard old builds" option via pipeline?

I have several jobs where I want to disable the option shown below in the jobs' configuration page. How can I do it via pipeline?
Chris F's user avatar
  • 411
0 votes
1 answer
59 views

Queue jenkins job task in azure pipeline won't complete

I have set up an azure devops pipeline with a single task - to queue a jenkins build job. The jenkins job is a parameterised pipeline build. The job queues and runs as expected in Jenkins. I would ...
Jonny's user avatar
  • 1
1 vote
2 answers
325 views

How To Convert Jenkins String Parameter To Terraform Map Variable? (Invalid number literal)

Edit (8/16/2023): I figured it out! I'm trying to pass string parameter(s) to a Terraform map variable, but receiving error "Invalid number literal". Jenkinsfile: pipeline { agent any ...
Mark Matlock's user avatar
0 votes
0 answers
30 views

How to use dynamic jenkin parallelism more efficiently?

I have the following code, which is dynamically running the pipeline in parallel. The issue is that the second set (group according to batchSize) is waiting until the first group completes ...
Dipak K Balabantaray's user avatar
1 vote
3 answers
195 views

How can I use a pipeline Jenkins shared library to implement encapsulation, inheritance, and polymorphism?

I'm trying to implement the Builder design pattern in a Jenkins pipeline shared library. Say I have the following file structure and pseudo-code (to only illustrate the concept I'm after) src/com/...
Chris F's user avatar
  • 411
1 vote
1 answer
644 views

Jenkins - how to run pipeline only if no other job is running on agent/master

I am trying to implement a maintenance job for cleaning up caches (e.g. Maven, NPM). In order not to disturb running jobs by deleting the caches the maintenance job should only run, if no other job is ...
Haagy's user avatar
  • 33
2 votes
2 answers
3k views

Jenkins try-catch the actual error instead of hudson.AbortException

how do I get the actual exception of a failed pipeline step/plugin? I have the following pipeline code try { checkout( scm: [ ... ] ) } catch (error) { echo error.getClass() ...
Haagy's user avatar
  • 33
1 vote
1 answer
157 views

Plugin for Jenkins truncates Terraform Plan output

The Blue Ocean plugin for Jenkins truncates the output of a Terraform plan at around 1700 lines, and shows a button "Show Complete Log" for the full thing. When I open the full log, ...
Heitor Morgado's user avatar
2 votes
1 answer
354 views

Passing Gradle credentials into Jenkins `dockerfile`agent?

I am looking at getting a newly provisioned Jenkins to run an existing dockerfile which does a gradle build and produces a runtime image which is then to be pushed to our internal docker repository. I ...
user18619318's user avatar
2 votes
1 answer
6k views

How to escape dollarsign in groovy shell command?

I'm making a declarative Jenkins pipeline which has a for loop to iterate over the output of a bash command. In that command it is necessary to use bash arguments e.g. "$1" for first ...
kotezbuzzi's user avatar
1 vote
1 answer
2k views

How to override global "environment {}" Jenkins Variables in a stage?

I'm trying to set up an automated Jenkins pipeline for the Development & Staging branches within our Git repository. I have most of the pipeline working. But I do not know how to override globally ...
ThatTechGuy's user avatar
0 votes
1 answer
528 views

Stage Parallelization in Jenkins declarative pipelines

I am trying to get a Jenkins (2.204.2) declarative pipeline to run parallel stages generated into a map on different machines. I am aware it can be done by mixing in the script block and I have done ...
iwantmyhatback's user avatar
0 votes
1 answer
4k views

Running this groovy jenkins script output this error "WorkflowScript: 17: expecting '}', found ':' @ line 17, column 11"

#!groovy env.BEARER_TOKEN = "uuuuuuuuuu" node { publishModule() } def publishModule() { stage('Deploy Modules') { } } def buildPayload() { def payload = { "data&...
green_car's user avatar
1 vote
0 answers
935 views

Best practice for building releases with Jenkins multibranch pipeline

We have started moving from Subversion to git (using Bitbucket, to be exact), and I'm unsure how to manage release builds with the multibranch concept. This is how we do it in Subversion: We have one ...
not2savvy's user avatar
  • 111
0 votes
1 answer
792 views

In jenkins how to restrict users to select first default element with other options in extended choice parameter

I have a jenkins job with multi select extended choice parameter. There are list of elements in a parameter. So, my requirement is I want to allow users to select multiple parameters excluding first ...
Jenkins-Learner's user avatar
2 votes
0 answers
308 views

Complete automatic release process (with versioning) on a multibranch pipeline?

We have projects that once in a while need to be released with all the changes already present in the develop branch. Every time we make a new release, we update the code with the new release version ...
José Cabo's user avatar
0 votes
1 answer
357 views

Force jenkins job to fail if stage did not run long enough

I am using Jenkins to build an rpm for some custom software. During the build there must be a race condition that only seems to appear when building the RPM, which results in the job finishing ...
Natolio's user avatar
  • 103
0 votes
1 answer
1k views

How to understand and resolve Jenkin job failure - Angular 13 app?

I'm new to Jenkins environment. I was asked to upgrade Angular 7.x app which was built 3 to 5 yrs back into Angular 13. Upgrading the Angular app is done. now I want to deploy my UI changes through ...
Flavio's user avatar
  • 1
1 vote
2 answers
473 views

Reuse block string without processing it on the fly

I have a block of code that work fine at the moment. But reuse that code is a little ugly. pipeline { agent any stages { stage('Stage 1') { steps { script { ...
navebinario's user avatar
0 votes
1 answer
408 views

Transferred 0 file(s) while transferring war file from Jenkins server to remote server

There's a jenkins server where my jenkinswar.war file is present in /var/lib/jenkins/workspace/project2/target/jenkinswar.war I want this file to be transferred to other remote server at /opt/docker ...
Manu's user avatar
  • 1
1 vote
1 answer
7k views

Jenkins checkout GitSCM and git step how does it work internally and why

When I execute my pipeline and I go and see on the actual Jenkins slave, the checked out commit doesn't have latest changes. But the logs and actual files in the workspace on the Jenkins slave running ...
Akshay Hiremath's user avatar
1 vote
0 answers
96 views

Access commit webhook message in Jenkins pipeline

I've got a Jenkins server integrated with a GitHub Organization through a GitHub App and the Jenkins GitHub Branch Source plugin, and it is working fine and triggering builds on commits as intended. ...
Johan Karlberg's user avatar
1 vote
2 answers
2k views

Rebooting node at end of Jenkins pipeline

I have a pipeline that runs on a dedicated bare metal node for automated performance benchmarking. Using bare metal is necessary due to the nature of the project. Near the end of the pipeline, the ...
Sagar's user avatar
  • 111
0 votes
1 answer
445 views

Understanding Jenkins plugins and agent

I was trying to understand jenkins agents. This page asks to first create jenkins docker agent. But it doesnt say where to execute these steps? Q1. Should we be executing these steps on node or a ...
RajS's user avatar
  • 141
1 vote
1 answer
7k views

Read and parse json file from workspace on slave node

I have a Jenkins job which runs on a slave node on another machine, both master and slave run on windows. The slave node is being run as a windows service. I am unable to read a json file from ...
Sreehari's user avatar
0 votes
1 answer
3k views

Create a folder in slave node using Jenkins pipeline groovy script

I have a Jenkins job which runs on a slave node on another machine, both master and slave run on windows. The slave node is being run as a windows service. The main repository has git submodule ...
Sreehari's user avatar
2 votes
0 answers
114 views

Jenkins declarative pipeline with mvn, releases and versioned artifactory

We have a requirement to support human defined versions (not auto generated) for patch releases. I'm trying to figure out a way to do this in Jenkins. We have: BitBucket, Jenkins, Nexus/JFrog (either)...
Kashyap's user avatar
  • 121
0 votes
1 answer
1k views

How to use the Shared Workspace plugin in a Jenkins pipeline?

I want to use the Shared Workspace plugin, so I set up the following key/value pair in my Manage Jenkins -> Configure System -> Workspace Sharing Name: sandbox-workspace Repository URL: git@...
Chris F's user avatar
  • 411
1 vote
0 answers
198 views

Add Cache-control: no-cache,no-store metadata to object uploaded via S3 Publisher plugin in Jenkins

So i have a jenkins job that builds a project and then uploads specific files to an S3 bucket. I've set up the S3 Publisher plugin shown in the attached image, but the metadata is still not being ...
BUCKSHOT's user avatar
2 votes
2 answers
4k views

Shared Jenkinsfile for multiple pipelines (separate source repositories)

I'd like to write one Jenkinsfile to be shared between a number (~50) of pipelines/jobs, where each job handles the creation of a library from a specific source (git) repository. Currently I have one ...
chrisb2244's user avatar
0 votes
0 answers
401 views

Mention users on Slack for failing builds

Scenario: I have jobs with Jenkinsfiles where I can get the env.BUILD_USER_ID exposed by a Jenkins plugin. So, what I`m planning to do is associating this variable content to the Slack user ID value, ...
the_piper's user avatar
0 votes
1 answer
1k views

Can one run a docker container with systemd from a jenkins pipeline?

I have been unsuccessful running a docker container with systemd from a jenkins pipeline without getting the following error message: ERROR: The container started but didn't run the expected command. ...
collin_tgz's user avatar
0 votes
3 answers
2k views

What is the best practice for a multibranch pipeline configuration?

I'm messing around with a multibranch pipeline in jenkins. Currently we have zero pipelines in production and everything is using freestyle jobs which is very sloppy. I have my own multibranch ...
collin_tgz's user avatar
0 votes
1 answer
486 views

Execute python file existing inside image with Jenkins

I have an Image A, which has a python file "main.py". I want to know how I can use Jenkins to run that file from a different pipeline. I want to use Jenkins to go inside that image and then ...
Taziamoma Abraham's user avatar
0 votes
1 answer
846 views

Checkout shared library with tag with legacySCm

So trying to checkout shared library by tag. This works perfectly with moderSCM, but for reasons we need to use other way (legacySCM); def lib = library identifier: 'jenkins-shared-library@41', ...
WhoAmI's user avatar
  • 101
0 votes
2 answers
161 views

Recommended starting guide on CICD

I'm new to the community, and I looked around a bit but didn't find a good point to start from. I have a specific problem I want to solve, but while trying to think of a solution I realized I need a ...
CIsForCookies's user avatar
1 vote
1 answer
1k views

Run multiple (dynamic list) other jobs from a single job

I have 30+ jobs in jenkins that deploy code. For any release, it could be 1 to 30 of those jobs that need to be run. Each job is standalone and deploys its piece independently. For simplicity let's ...
Brian Pipa's user avatar
1 vote
1 answer
2k views

net.sf.json.JSONException: Invalid JSON String error on jenkins

Warning: API call to create metrics set failed: [Pipeline] echo net.sf.json.JSONException: Invalid JSON String at net.sf.json.JSONSerializer.toJSON(JSONSerializer.java:143) at net.sf.json....
aymen0406's user avatar
1 vote
1 answer
718 views

Why does Jenkins' Stage View not show my jobs as ending?

I am using Jenkins' remote API (XML & JSON) to submit Jobs, run them & retrieve the logs. When observing the jobs in Stage View, I noticed that (following a change in my "submission ...
MBaas's user avatar
  • 113
2 votes
1 answer
2k views

Re-running a pipeline job if failed

I've heard about the Naginator plugin, but unfortunately it's only for freestyle job type. Is there any solution for pipeline jobs to be triggered if they failed? I thought about creating a command in ...
Lev Meshorer's user avatar
2 votes
1 answer
206 views

Jenkin "unable to find valid certification path to requested target" getting error while installing plugin

We are trying to set up jenkins. When we trying to install plugin getting the below error. We also tried to import the trusted certificate into the JVM directly still getting same error. sun.security....
Jagruti Patil's user avatar
1 vote
2 answers
304 views

Package installed using Dockerfile not available on Jenkins pipeline stage

I'm having sort of a weird problem with my Jenkins pipeline. I've defined a Dockerfile which installs some tools I need for my CI/CD pipeline, such as node, npm, sfdx, and sfpowerkit (a plugin for ...
Pietro Zuntini's user avatar
0 votes
1 answer
596 views

Jenkins Pipeline job does not use Squid Proxy

I have configured a Squid Proxy and it seems to be working when I add below Env variables to the /home/user/.bashrc file to a client machine. Note: SSL Bump is configured, Self Signed Cert is added to ...
kalanatd's user avatar
2 votes
2 answers
5k views

Send command to docker image while start in Jenkins file

In scripted Jenkinsfile if I need to send a command to Docker image, I can do like this: docker.image('mysql --default-authentication-plugin=mysql_native_password') How can I do the same in ...
MRashad's user avatar
  • 31

1
2 3 4 5 6