Questions tagged [jenkins-pipeline]
For questions specifically about Jenkins 2.0's pipeline architecture. This includes both declarative and scripted pipelines.
204
questions
1
vote
0answers
10 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
...
1
vote
0answers
9 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
votes
0answers
20 views
Jenkinsfile that creates dynamically stages from a list with different branch name
I'm trying to creates dynamically stages from a list
but this always giving me an error due to the fact that this script is taking the name of branch same as stage name.
How could we change the branch ...
0
votes
1answer
83 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
25 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.
1
vote
1answer
13 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
49 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
24 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 ...
1
vote
0answers
34 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
98 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
43 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
17 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
134 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
38 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
708 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
31 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
40 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
31 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
1answer
42 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
229 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 ...
1
vote
0answers
31 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
148 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 ...
1
vote
1answer
76 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
519 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 ...
2
votes
0answers
153 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 {
...
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 ...
3
votes
1answer
100 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
1k 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
53 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
49 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
434 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 ...
1
vote
1answer
120 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
43 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 ...
2
votes
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
44 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
207 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
2answers
286 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'){
...
2
votes
2answers
127 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 ...
1
vote
1answer
196 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. ...
1
vote
1answer
151 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
648 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 ...
2
votes
2answers
450 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
2answers
300 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
59 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.
...
2
votes
1answer
3k 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
|->...