Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [jenkins-pipeline]

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

0
votes
0answers
5 views

Unable to view performance trend images in Performance Report - Apache JMeter

We are using Apache JMeter for Load testing in Jenkins Pipeline and at the end of the execution we are using trying to publish the result and the result is getting published. However, we are not able ...
0
votes
0answers
7 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
1answer
17 views

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

Im 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
27 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 ...
-1
votes
0answers
7 views

How to decare a Clamav scanner in a Jenkins pipeline?

I have a declarative Jenkins pipeline that looks like the following: pipeline { agent any stages { stage('SonarQube analysis') { steps { script { scannerHome = tool '...
0
votes
0answers
22 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
36 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
0answers
74 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
60 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
77 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
70 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
23 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
51 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
29 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
37 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
29 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
26 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
34 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
24 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
80 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 ...
3
votes
0answers
77 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
15 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
118 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. ...
0
votes
1answer
444 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
1answer
536 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
20 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
37 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
38 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
142 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
74 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
38 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
31 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
146 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 ...
1
vote
2answers
2k 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
45 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 ...
3
votes
1answer
2k views

Jenkins Groovy to parse console output and mark build failure

What would be a Groovy or pipeline step to parse Jenkins console output, identify a string and mark the build as failure if the string is matched?
0
votes
0answers
34 views

trigger a build on a specific branch when a branch is deleted?

Using multibranch pipelines with webhooks. When I delete a branch my jenkins projects immediately update and prune the branch. This is great but could I trigger a build of master branch when another ...
0
votes
1answer
163 views

Jenkins Pipeline project can't when on branch

I want to use when on branch condition. The Jenkinsfile is like this stages{ stage('Checkout project branch master'){ steps{ withCredentials([...
0
votes
0answers
26 views

Jenkins VCS Plug in Snapshot

I have an issue where i make a snapshot of a slave VM after is completed the slave is connected but the workspace is not refreshed in the VM. pipeline{ agent none stages { stage('Pre-...
2
votes
1answer
998 views

Jenkins-Ansible: executing ansible playbook using jenkins pipeline script

We developed declarative pipeline code to execute an Ansible playbook. We tested the playbook from CLI and it is working properly. My playbook actually performs some shell commands on remote server. ...
2
votes
1answer
1k views

jenkins pipeline nested parallel

Jenkins pipeline, declarative. simple question, how do I create a parallel stages inside stage which is parallel by itself? pipeline { agent { label 'master' } options { timestamps() timeout(...
1
vote
1answer
2k views

Passing variables between scripts in a Jenkins pipeline

I have a declarative Jenkins pipeline that looks like the following: pipeline{ agent { ... } stages { stage("Provision EC2 Instance and Set ENV Variable"){ ...
4
votes
2answers
159 views

How to retrigger a Jenkins build after failure using declarative syntax?

I am using declarative pipeline syntax. I want to re trigger my build for 3 times if it fails. I want to add this step in my pipeline may be in post step: Something like below: post { failure{ ...
1
vote
1answer
57 views

Manage Docker images and their child images in a pipeline

I have various Jenkins agents images and I am trying to add automation to it. I have a base java image called agent-base and those who inherit from that one. Eg: agent-ansible, agent-terraform and so ...
0
votes
1answer
1k views

Parallel stages running on same agent in Jenkins declarative pipeline

I've been using a Jenkins pipeline with a parallel step for testing like this: pipeline { agent { label 'php' } stages { stage('build') { steps { ... ...
1
vote
1answer
79 views

Always execute post statement in a jenkins pipeline when a conditional statement is met

Although it seems counterintuitive, I would like to execute an always statement when a conditional is met. In my pipeline, my post statement should always destroy my AWS CloudFormation Stack if a ...
0
votes
2answers
304 views

Jenkins pipelines vs matrix vs multiple jobs for multiple branches across multiple platforms

I've never done any CI work before, so I'm struggling to decide how to set up Jenkins as my first project at my new job. From what I (sort of) understand: Jobs are the generic work unit Pipelines ...
0
votes
0answers
66 views

Best alternative to deploy/update docker using Jenkins for CI/CD

I'm running Jenkins as a docker image, and I'm looking for the optimal way to deploy new (or update existing) docker images (example staging and prod environment). I've founded this example : https://...
4
votes
1answer
3k views

Jenkins Pipeline “Build when a change is pushed to GitLab”

I have a Jenkins declarative pipeline that is ran via a webhook from GitLab whenever a change is pushed to my repo. In Jenkins, I have the following trigger option selected: Is there a way for me to ...