Questions tagged [jenkins-pipeline]

For questions specifically about Jenkins 2.0's pipeline architecture. This includes both declarative and scripted pipelines.

0
votes
1answer
18 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
9 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
22 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
0answers
24 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
66 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
16 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
16 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
47 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
86 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
23 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
39 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
16 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
24 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
61 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
56 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
22 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
18 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
54 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
83 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
32 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
59 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
165 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
337 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'){ ...
0
votes
1answer
415 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
114 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
236 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
0answers
33 views

Write configuration to stdout in Jenkins Pipeline?

Can I write generated configurations to standard out in Jenkins as demonstrated in the below sample? Use Case node(example) { container(example) { # generator writes configurations to stdout ...
0
votes
1answer
110 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
1answer
33 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
14 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
33 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
114 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
74 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
1answer
146 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
175 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
37 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
368 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
2k 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 = "...
1
vote
2answers
3k 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
34 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
64 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
43 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 ...
0
votes
2answers
348 views

Transfer files and execute commands from jenkins scripted pipeline to AWS instance

I want to transfer files and execute a few commands on remote AWS instance from Jenkins. I have the following methods in mind to do the same. Note that my Jenkins server is running in the local server,...
0
votes
3answers
149 views

Jenkins in private subnet

For development environment, to be used by multiple developers, we have a pipeline to be created with Git-Jenkins-Tomcat(dev) Do I need to place jenkins in private subnet and access thru bastion host?
0
votes
0answers
50 views

Jenkins CLI from Jenkinsfile

I would like to call the Jenkins CLI from a Jenkinsfile. I am thinking that I can use the shell directive and call the cli via the client jar. For example sh 'java -jar /path/to/client.jar...' ...
0
votes
0answers
38 views

Move artifacts files and folders to a one (release) folder

What is the best approach/ plugin to move multiple files and folders to a new release folder? (I'm using the Jenkinsfile pipeline) Case: The next files/ folders need to be available in the release ...
0
votes
1answer
252 views

packge.json not found while executing on Jenkins

My Dockerfile looks something like this. FROM mhart/alpine-node:8.11.3 RUN mkdir -p /app COPY ./ /app WORKDIR /app/build RUN yarn global add serve CMD ["serve", "-l", "3000"] EXPOSE 3000 And ...
2
votes
2answers
3k views

Jenkins pipeline pass upstream build number to downstream job using Pipeline script

How to pass upstream build number to downstream job in Pipeline job using (Trigger parameter build on other projects) ? Agenda: To pass upstream job build number to downstream job to download ...
1
vote
0answers
47 views

Pass Variable in pipeline script

I am trying to pass a variable input to "credentialsId: $creds" from SiteID but unable to. I tried multiple expressions in pipeline script with quotes etc and none worked. I am learning and need ...