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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

0
votes
1answer
13 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 ...
0
votes
1answer
13 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. ...
1
vote
1answer
25 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 ...
0
votes
1answer
13 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 ...
1
vote
2answers
40 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=${...
-1
votes
0answers
20 views

Jenkins Default Kubernetes Cloud Config Data

I'm managing huge pipeline with Jenkins.Running distributed jobs under Kubernetes provider. So that , I'm creating pipeline and creating connection with Jenkins Kubernetes plugin . How I can set ...
2
votes
1answer
38 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 ...
0
votes
1answer
25 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
39 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 ...
3
votes
0answers
36 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
28 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: ...
0
votes
1answer
148 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
44 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
28 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
116 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
1answer
58 views

How to properly automate CM?

Lets say I have a number of tools like docker bench security, some static security scanners etc etc. Now I have lets say free ansible edition (no expenses are considered). I have lots of logs, but not ...
1
vote
0answers
121 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('...
0
votes
2answers
244 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
28 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
45 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 ...
1
vote
1answer
645 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
473 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. ...
0
votes
1answer
356 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 ...
0
votes
1answer
271 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
49 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 ...
5
votes
3answers
323 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 ...
1
vote
1answer
717 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
588 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
44 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 ...
1
vote
1answer
2k 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. ...
6
votes
2answers
375 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
484 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
216 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' ...
2
votes
1answer
281 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:...
3
votes
3answers
129 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
781 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
532 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
322 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)...
5
votes
2answers
2k 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
47 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
785 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
114 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 ...
0
votes
1answer
230 views

jenkins slave issue with EnvInject

Recently our remote jobs started to fail, probably due to plugin updates. I've found the related error logs, but could not find a way to fix it. Any ideas? From the console of the job [EnvInject] - [...
5
votes
2answers
2k 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
215 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 ...
2
votes
2answers
844 views

How to check return status of parallel branches in jenkins pipeline

I am running a Jenkins job on multiple slaves. Following is the code structure: def branches = [:] def allNodes = Jenkins.getInstance().getNodes() for (int i =0; i < allNodes.size(); i++) { ...
4
votes
2answers
207 views

Jenkins managing a pool of servers across restarts

I have a pool of servers to test a provisioning process my team owns. One server is needed per branch or PR. The process requires reboots. Once the process is run, we run some tests. A Jenkins ...
9
votes
1answer
1k views

How do I trigger scripts on a merge or when a branch is deleted?

I am using jenkins multibranch pipelines. If a branch is merged and deleted jenkins removes the branch from the pipeline as well. This is great, but I want to run a command/script when a branch is ...
4
votes
2answers
622 views

PRs not automatically getting trigger in Jenkins github organization

We are using Github for source control and Jenkins for our builds. In Jenkins, we are using GitHub Organization Folder plugin along with Multibranch pipeline plugin. This causes the repository to ...
2
votes
1answer
255 views

Jenkins bitbucket-build-status-notifier-plugin posts status to repo of shared pipeline library!

I am attempting to implement the Jenkins bitbucket-build-status-notifier-plugin, found here: https://github.com/jenkinsci/bitbucket-build-status-notifier-plugin We used the shared-pipeline code ...