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
17 views

Pushing to bitbucket from within container using ssh in Jenkins declarative pipeline

I am working on a project where the build generates a file that is needed to keep some ids consistent, therefor I need to be able to make a commit and push it to a Bitbucket repo from within the ...
1
vote
1answer
16 views

How to use comments to trigger rebuilds of Bitbucket pull-requests on Jenkins multi-branch pipeline

I have successfully configured a Jenkins multi-branch pipeline to build my project which is hosted on Bitbucket. I have separate pipeline requirements for the "develop" and "release" branches, and for ...
0
votes
0answers
16 views

Rancher Pipeline: How to pass environment variables from one stage to another

Currently I am trying to move our existing build infrastructure to Rancher with its CICD pipelines. My main question is: Is it possible to pass environment variables from one stage to another? Our ...
0
votes
0answers
18 views

Test results published multiple times in Jenkins?

To record test results in jenkinsfile I am using the line below in the start of the build: junit testResults: 'build/*/*/target/surefire-reports/*.xml' To evaluate the above test results, I'm using: ...
0
votes
0answers
22 views

What is a reliable process for continuous load testing?

We have several applications under heavy development which will eventually be deployed as web or mobile apps. We already do unit and integration tests with the target environments in which they will ...
0
votes
1answer
28 views

Can “When” like keyword be used in scripted pipeline?

stage('My Conditional Stage') { when { branch 'master' } steps { echo 'Do that only on master branch' } } For Scripted pipeline ; if value of i is 0 then we need skip ...
0
votes
1answer
43 views

Jenkinsfile for monorepo & monobranch

I'm currently working on a Microservice architecture-based project and writing Jenkins Pipeline for it. The project structure is as follows: Web Service (master) Jenkinsfile Service 1/ Jenkinsfile ...
1
vote
1answer
166 views

Jenkins pipeline: do “Declarative: Checkout SCM” step only

I'm newbie in Jenkins. I've created pipeine with parameters in Jenkinsfile in git. It works fine. Problem is: when I push new parameters into Jenkinsfile, then press button "Build with Parameters", ...
1
vote
1answer
86 views

How to trim spaces for parameter value in jenkins pipeline?

I am using jenkins pipeline job with parameters. when i had any trailing spaces in parameter value the job gets failed. is there any way to trim the spaces in pipeline job to avoid build failure?
0
votes
0answers
22 views

Giitea Webhook x509: certificate signed by unknown authority

On openshift cluster i deployed gitea v1.9.0 and i added a webhook for triggering the pipeline, now i'm getting the following error: Delivery: Post https://ip@:8443/apis/build.openshift.io/v1/...
0
votes
2answers
28 views

Equivalent of GitLab's “before_script” for Jenkins?

I'm looking for Jenkins' equivalent of the before_script keyword provided by GitLab. So far what I found is the input keyword that you can use before entering the steps part of the stage, but this ...
0
votes
1answer
48 views

Docker fails to mount volume inside Jenkins scripted pipeline

I'm working on a CI Jenkins build with scripted pipeline. From Jenkins on one machine, I'm connecting with already configured Jenkins slave on another machine (M2). I'm able to successfully execute ...
5
votes
3answers
80 views

What is the optimal size of a Jenkins Pipeline Stage?

Should I create single checkout stage or multiple stages like checkout scripts, checkout code, checkout something else? How should I decide on what piece of logic to put into separate stage? Or are ...
0
votes
0answers
73 views

GitHub Payload in Jenkins

I'm using the GitHub plugin with Jenkins, and I'm trying to figure out how I can access the webhook payload. I'm aware that the Generic Webhook Trigger has this ability, as well as the GitHub Pull ...
0
votes
0answers
38 views

Jenkins Pipeline milestone unexpected behavior

I would like to know if there is something wrong with below pipeline script. Step 1 : Trigger a pipeline build with the error error commented out Step 2 : Immediately trigger another pipeline build ...
0
votes
2answers
54 views

Why many companies prefer Jenkins than Aws CodePipeline? [closed]

I have searched few job sites. Many companies are searching engineers who can handle Jenkins as CI platform. I think the Aws CodePipeline is easier than Jenkins. Anyone can advise me, please. Thank ...
0
votes
1answer
286 views

How to write a dynamic declarative pipeline that contains sequential job inside parallel job

I'm trying to write a declarative pipeline code that accepts a map and create a pipeline. I can able to achieve sequential stages or parallel stages but facing problems while making a pipeline that ...
0
votes
1answer
30 views

How to automate the process of patching Jenkins Slave instances in AWS

I've been working on an automated patching solution for some infrastructure in one of our AWS accounts. This AWS happens to host the Jenkins instance we use for CI/CD actions, among other things. ...
0
votes
2answers
87 views

Jenkins pipeline lock resources

I need to run commands on my pipeline during a certain stage, on devices which connected to my Jenkins as slaves. But I want them to run only when another one finished. On the other hand, I want them ...
0
votes
1answer
38 views

Jenkins run build in docker on server (withDockerServer not working)

I am trying to run my build inside a docker; but I don't want the docker to run on the jenkins master but on another server that has docker running. What does work: inside jenkins configure a docker ...
0
votes
0answers
26 views

Jenkins constantly loses build history

I encounter a problem in Jenkins that is related to build History. The history is constantly resetted to build number 1 even if I don't have any build discarder option added on my Jenkinsfile. If i'm ...
0
votes
2answers
408 views

How to trigger Jenkins Pipeline by push in specific branch in Bitbucket?

I've created Jenkins Pipeline Job, activated "Build when a change is pushed to BitBucket" trigger. I've also specified branches to build. But pipeline is triggered by all branch changes. Also I've ...
1
vote
1answer
499 views

Set environment variables then run script in Jenkins Scripted Pipeline

I am new to Jenkins, Groovy and pipelines. I have created a simple pipeline stage like so: //working build but not setting env variables node('build-01') { stage('Building') { echo "[*] ...
0
votes
2answers
39 views

How to use stored certificate in Jenkins declarative pipeline?

I have a stored certificate in Jenkins, and I need to use it in a pipelinebuild job, but the problem is it appears the Pipeline can't use certificates: trying to use: environment { KEY = ...
0
votes
0answers
137 views

Can Load Shared Libraries in Jenkins But Not Able to Create New Objects

I am trying to implement Shared Libraries in my Jenkins scripted pipeline. I was able to configure Jenkins to pull the library from Git. I currently have one file, vars/Pipeline.groovy which I'm ...
0
votes
2answers
67 views

what is better between Jenkins & AWS CodeDeploy for CI/CD

I'm considering what is better and easier to use for CI/CD pipeline between Jenkins and AWS CodeDeploy. e.g. Jenkins server request webhook to git repo(github), and deploy to EC2. e.g. When push to ...
0
votes
1answer
201 views

Load Balancing of Jenkins Nodes without Load Balancing Plugin?

we currently want to introduce a loadbalancing on the Jenkins server and our nodes. I have already created several nodes. Currently it is also so that if a node is blocked accordingly, that the next ...
0
votes
0answers
39 views

jenkins pipeline parameters grouping

I am using 'choice' parameter in Jenkins pipeline(Declarative) and I have over 25 different parameters. I am looking to group the parameters into 4/5 choices but still want the option to be able to ...
0
votes
1answer
74 views

Get vars in Jenkins Pipeline

In FreeStyle Project, I have lots of env vars, which are available from any part of Jenkins' job. I also used ghprb plugin to trigger that job against GH PRs, which added some extra env vars. Later, ...
1
vote
2answers
270 views

Jenkins Shared lib not working properly

Recently I tried to add Shared Libraries to my Jenkins instance to make it easier to maintain all code that runs in each project. I have a repo myorg/jenkins Inside of it I have Jenkinsfile and ...
1
vote
2answers
623 views

Cleanest way to prematurely exit a jenkins pipeline from inside a withEnv

In a Jenkins scripted pipeline with the below structure, the return command will exit only the withEnv. node{ withEnv([...]){ stage('1'){ ... } stage('2'){ ...
1
vote
1answer
961 views

Multiple levels of parallel stages in a Jenkins declarative pipeline

I need to define a declarative pipeline with multiple levels of parallel stages as such: 1 Prebuild_action1 2 Prebuild_action2 3.1 Build platform_1 4.1 Test1 platform_1 4.2 Test2 platform_1 4....
2
votes
2answers
169 views

One Jenkinsfile or multiple?

So I have a Jenkinsfile defining a build pipeline and then a Jenkins job (not pipeline) with a very simple deployment script for our Docker stacks. Seeing that Jenkinsfiles can become as complex and ...
0
votes
1answer
26 views

What options are available to report the build status of Jenkins Multi Pipeline's first branch build on k8s to bitbucket-cloud?

Background The Bitbucket Status Notifier plugin has been configured. The status was reported, but since more and more jobs have been moved to Jenkins-on-steroids that is running on k8s, buildStats ...
0
votes
1answer
791 views

Jenkins - Scripted Pipeline - Input String

I am struggling to set up an input step in a scripted Jenkins pipeline that will let me as the user to input a string. Scenario: I am building a Docker image. I want to ask the user what tags to tag ...
0
votes
1answer
322 views

Jenkins parameters default to env variable?

I am trying to crate parameters field which is default to current build no. parameters { string( name: 'DEPLOY_BUILD_NUMBER', defaultValue: '${BUILD_NUMBER}', description: ...
0
votes
2answers
50 views

How can I achieve better load balancing of different systems on a Jenkins?

We have four test machines spread over a Jenkins. We would like to have a better distribution. Example: If machine one is running with a test job, the second job should detect that node one is ...
0
votes
0answers
16 views

How to define a salt variable with two or more inputs from Jenkins parameter?

I am defining a variable in Jenkins pipeline script as: USER = "xx-yy-${Target}-zzz" Here ${Target} is from a Jenkins comma separated parameters (server1,server2). properties([ parameters([ ...
0
votes
1answer
39 views

Does Jenkins job create Jenkinsfile? On execution

On creation of a new job(as free style project), and running it, I see that Jenkinsfile is generated in job's workspace, after running the job. But I see that all the pipeline code is commented. ...
0
votes
1answer
240 views

How to restrict only one parameter in jenkins pipeline

I have the below pipeline script with string parameters. The Target parameter will fail if multiple comma separated inputs are provided in Jenkins. How can I restrict the Jenkins pipeline to accept ...
0
votes
0answers
140 views

How to tar a specific folder from git repo using Jenkins pipeline?

I have a Jenkins job with Repo URL example.repo under config. The job is to create a tar of specific folder under example.repo and not the entire repo. The issue I see is, it does a tar of entire repo....
3
votes
2answers
202 views

Is containerized deployment of jenkins on ECS better than running jenkins inside EC2 instance to secure pipeline information?

I am new to AWS, docker and jenkins. I want to run a jenkins build pipeline and I have tried using following two ways on AWS: Running jenkins inside the EC2 instance following the steps at this AWS ...
2
votes
0answers
305 views

Can I use the Jenkins Rest API with user input?

I want my Jenkins Pipeline to have a user input step where it posts to a slack channel and waits for user input then uses the input to user enters (button in the slack message). So at the input step ...
0
votes
0answers
51 views

Provisioning & Configuring VM on Azure

As part of QA pipeline(in Jenkins), we need to add a provisioning and configuration automation of a VM to run the QA tests. Jenkins pipeline can trigger ansible code for provisioning and ...
0
votes
2answers
658 views

Jenkins Dockerfile declarative pipelines: getting the built image tag

I'm trying to get the image tag generated with the help of the dockerfile agent in Jenkins declarative pipelines. This Jenkinsfile is incomplete though, because I still need the deployment steps. ...
1
vote
1answer
3k views

How to define global variables in groovy file, which I want to load and consume?

I have a Jenkins parent groovy file which consumes the child groovy file Parent grooy file: ... def child = load 'child-groovy-file'; child.execute(); Child groovy file: a = "first letter"; b = "...
2
votes
2answers
6k views

How to define variable in Jenkins scripted pipeline

I defined variable in declarative Jenkins pipeline script but having issues with simple variable declaration. Here is my script: pipeline { agent none stages { stage("first") { ...
1
vote
0answers
57 views

Define views in Jenkins Multibranch pipeline jobs

Is it possible to somehow define views in Jenkins multibranch pipelines? I'd like to have a second view (after the Branches (NUMBER)), that shows only enabled branches. But I also want to keep the ...
1
vote
0answers
76 views

Jenkins - IBM UrbanCode - AWS & Azure cloud

For continuous delivery, we do manual deployment after generating binary artifacts from Jenkins pipeline(in an automated process). Further, for continuous deployment, we would like to use IBM ...
0
votes
2answers
64 views

How to get list of env variables from the root folder to jenkins job?

Using configure option, when we check the environment variables, we get only the variables which are available with in the folder or job. But, I want to get complete list of env variable from the ...