Stack Exchange Network

Stack Exchange network consists of 174 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.

1
vote
0answers
11 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"){ ...
1
vote
1answer
22 views

Jenkins Retrigger When build fails

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 { ...
1
vote
1answer
28 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
35 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
17 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
36 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
42 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://...
2
votes
1answer
204 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 ...
1
vote
1answer
57 views

Jenkins Pipeline GitLab API Credentials Management

I have a Jenkins pipeline that executes a build whenever a change is pushed to the appropriate branch. Jenkins uses an API token to authenticate with the GitLab server and checkout the repository. ...
3
votes
1answer
40 views

In Jenkins, how can parameters that contain spaces be referenced?

Google has failed to even lead me to a proper answer as to why spaces are permitted in names of Jenkins parameters, let alone how to reference them. Assuming it's not just a major oversight, how does ...
1
vote
1answer
79 views

Jenkins Pipeline Kubernetes Agent shared Volumes

I have a Jenkins Pipeline using Kubernetes Agent. I schedule multiple containers in my pod template. I recently wanted to add volumes that would be shared some of the containers and am having ...
2
votes
3answers
96 views

Jenkins UUIDs … oh the humanity

I have an environment block environment { SUITE_RUN_ID = UUID.randomUUID().toString() SMOKE_CMD = "runtests.sh SUITE_RUN_ID=${SUITE_RUN_ID}" FAILED_TESTS = "output_rerun_info.rb SUITE_RUN_ID=${...
3
votes
1answer
83 views

Jenkins Job vs Jenkins Pipeline

BACKGROUND : We have one Selenium automation project which is shared in BitBucket repository. Project is maven project. we have 10 testng.xml files for all modules OVERVIEW: Now we want to trigger ...
1
vote
1answer
67 views

Jenkins Pipeline job - remember previous values

I have a Jenkins Pipeline which uses Terraform and create a compute environment in GCP. There are like 5 questions in the build i.e. 1) GCP Project Name 2) Number of RHEL Servers 3) RHEL Server names ...
1
vote
1answer
89 views

Should I run CI on merge state or HEAD of branch in a PR?

I'm using Jenkins Pipeline with Github for our CI purposes and I'm trying to think what the strategy should be for what is checked out to run. Jenkins provides three options when discovering pull ...
4
votes
0answers
84 views

Force Jenkins to reschedule parallel pipeline step as soon as node goes offline

Exactly this. In our environment, we're using GCE preemptible nodes and the Jenkins GCE plugin. As a consequence of this, it's highly likely (even expected) that a node will go away during the course ...
0
votes
1answer
48 views

Jenkins “internal” pipeline script producing errors when running sh steps

I've been experimenting with creating a new pipeline, using the built-in pipeline editor (i.e. not from SCM). The strange bit is that, when I run any sh step, I receive the following error: sh: 1: ...
2
votes
1answer
766 views

Triggering specific pipeline builds for monorepos in Jenkins

I'm in the process of converting multiple repositories into a single repository, our CI tool of choice is Jenkins due to the conversion of multiple repository structures into a single one 2 main ...
1
vote
1answer
60 views

Trigger a job and get the job log on the same page in Jenkins

I would like to trigger the job in Jenkins and also get the log on the same page. E.g. Kind of IDE where we can run the code in one side and get the output on the other side. Are there any tools ...
0
votes
0answers
41 views

How to supress the error got from httpRequest in Jenkins pipeline

I have custom pipeline file in Jenkins and I am experiencing some kind of problem with httpRequest. I am making HTTP request to some external system just to notify about the build. This request is ...
3
votes
1answer
416 views

How not to break Jenkins Pipeline when adding new parameters (declarative pipeline)

An Issue I have been struggling with is whenever I add a new parameter to a Jenkins Pipeline, the next job will not correctly get this parameter. This is especially an issue if those parameters are ...
3
votes
0answers
76 views

How to properly automate CM?

Let's say I have a number of tools like Docker bench security, some static security scanners, etc. Now I have let's say free Ansible edition (no expenses are considered). I have lots of logs, but not ...
1
vote
0answers
396 views

How to test whether a variable exists in the declarative pipeline

I am using the Build User Vars Plugin which sets various variables in the pipeline. Here is what I am currently trying: wrap([$class: 'BuildUser']) { def safeBuildUser = binding.hasVariable('...
1
vote
2answers
683 views

Where should we keep application properties file while doing build promotion using Jenkins?

We are using spring boot to develop Java backend services. application.properties file has the database configurations. We are deploying in 4 different environments (dev, test, UAT, and production). ...
0
votes
0answers
49 views

A way to convert between bamboo and jenkins pipeline codes

Is there any format, and/or converter to move pipelines between these two CI systems?
0
votes
1answer
88 views

Issue with parametrized pipelines during deployment by seed job

I use "seed plugin" for automatic deployment pipeline changes into Jenkins. Most of my pipelines which are being deployed by seed plugin job have build parameters (parametrized jobs). When seed job ...
2
votes
1answer
994 views

Trigger downstream pipeline job via generated variable in upstream freestyle job

I have an upstream freestyle job and a downstream pipeline job. The freestyle job is triggered via a Bitbucket hook to run whenever code is pushed to Bitbucket. The freestyle job should capture ...
2
votes
2answers
1k views

Trigger jenkins pipeline job with Bitbucket hook

I'm missing something obvious here. Is there no way to trigger a Jenkins scripted pipeline job via Bitbucket hook? There's a bug out about it but it's been around for years with apparently no fix. ...
3
votes
1answer
1k views

Jenkins Pipeline - input only if branch matches

I want to ask for input but only if we are on a certain branch. But the input is run before the when. Can this be done with declarative syntax? For example this will always prompt even when the ...
1
vote
3answers
515 views

Jenkins declarative pipeline: use branch if it exist

I'm currently trying to atopt my declarative pipeline in the following way: I have multiple stages, some apply for all branches, some only for specific names. What I'm now searching for is a way to ...
0
votes
0answers
79 views

Is it possible to connect Jenkins Groovy Pipelines with Artifactory?

I have a Groovy Pipeline with Jenkins 2.32.1 I can read Pipeline definition from Pipeline script Pipeline script from SCM (Git, Mercurial or Subversion) Is there any method or plugin to read from ...
6
votes
3answers
473 views

Determine the URL for a SCM trigger from inside the build

My Jenkins is affected by a known Jenkins bug where it will trigger jobs that have an SCM poll set if a change to the shared library happens. I can't have this, so I thought I would get the trigger ...
2
votes
1answer
1k views

How can I push multiple containers, created with docker-compose, to a registry

I am using Jenkins pipeline and run a shell command to bring up my linked containers for testing. Once the testing is complete, I want to push the containers to a registry (I would prefer AWS ERC, but ...
0
votes
2answers
793 views

How to use Jenkins Pipeline and choose triggers for email notifications?

Before Pipeline, I used Email-ext plugin to define triggers for sending emails (on first failure, and when back to success). But in the Pipeline version, I can't control the triggers, I can only "...
0
votes
1answer
53 views

Jenkins, Jenkins SSH Plug-In, EC2, “ubuntu” user and “www-data”

I am trying to install Jenkins to achieve a Github -> EC2 instance folder pipeline. So far everything works well when I target an empty folder... however, when I target my production folder owned by ...
3
votes
1answer
3k views

sshagent and jenkinsfile

I am new to Jenkinsfile. I have previously configured my Jenkins job from GUI, and we are now upgrading our server to use Jenkinsfile. My job contains a section which needs to SSH to another server. ...
7
votes
2answers
542 views

Is there a way to run the Jenkinsfile from command line?

I don't want to use Jenkins UI, instead I would like to use the command line, from command line I want to execute Jenkinsfile to the Jenkins server. Is this possible? Let's say I have a Jenkinsfile, ...
1
vote
1answer
1k views

How set and get var with Path?

I write script for deploy files by ssh via Jenkins #!groovy node('superhost01'){ String HOSTNAME="host01" String USERNAME="tech_user" withEnv(['PATH=/data/jdbc_connector']) stage('...
0
votes
0answers
284 views

Jenkins Kubernetes Plugin - How to keep containers for n minutes in Declarative Pipeline

Currently trying agent { kubernetes { cloud 'jenkins-jenkins' label 'node' inheritFrom 'default' containerTemplate { idleMinutes '60' name 'node' ...
3
votes
1answer
744 views

Get changes of the parameterized pipeline on the fly in Jenkins

Is it possible to get changes of the parameterized pipeline on the fly after making changes there? For example I have a pipeline code: properties([ parameters([ string(name:...
4
votes
3answers
355 views

How to restore default Jenkins plugins?

I do a lot of testing in my Jenkins VM which I have on my local laptop. I found this time-consuming to remove Jenkins and installing again from scratch. It would be better if I have a simple way to ...
0
votes
3answers
1k views

How can I clean/delete a Jenkins workspace after merge?

I would like to keep a workspace in Jenkins until after the pull request is merged. Meaning, I don't want to clear the workspace after every build, but I also don't want to clear the workspace only ...
0
votes
1answer
746 views

how to integrate docker-compose or docker run command arguments into SCM and Jenkins build

When I do docker run I have to give extensive argument options for my container setup. To mitigate this and ensure all developers are using the same arguments I switched to docker-compose. Now ...
0
votes
1answer
490 views

Using Jenkins to control docker image build flow

I'm trying to figure out the proper way to get build environments into a CI pipeline. What I want to achieve is: someone pushes to the docker source repo (not registry, a repo with the docker folder)...
6
votes
2answers
4k views

Multibranch Jenkins Build - How to disable some branches only

I have a multibranch job set to run any branch with a Jenkinsfile. I have some options I can think of if I want to remove a branch from the list of jobs running for the multi-branch pipeline. I can ...
0
votes
0answers
52 views

How can I best test Jenkinsfile with plugins? [duplicate]

I'd like to replicate building a pipeline in my personal lab with similar conditions to what my Dev/QA goals are. I already have an AWS-hosted jenkins server, but my understanding of how Nexus & ...
1
vote
0answers
1k views

How to start a VPN connection using Jenkins?

I'm on a Windows Server and I want to have a pipeline project on Jenkins that basically does this: SVN update Build Deploy As the deploy target machine is on a different network, I want to know how ...
0
votes
1answer
171 views

Compatibility of http-builder-ng Groovy module with Jenkins 2

Did somebody had a chance to use http-builder-ng Groovy module in Jenkins pipeline? When I use this module with any kind of request/URL it always returns me null object when the same source code ...
6
votes
2answers
3k views

Is it possible to use a JenkinsFile in one repo to build and deploy a related repo?

Our team has two separate repositories for a frontend/backend system. They would like to have these two repositories deployed to the shared team environment together. My understanding of the ...
4
votes
2answers
261 views

How to perform continuous Integration using Jenkins?

I've the basic idea about the Continuous Integration using Jenkins like- basic project setup, setting up source code management bit-bucket and build the project. I have done this so far and following ...