Questions tagged [jenkins-2]

Jenkins is an extensible continuous integration server. Jenkins is open source and has packages for Linux, Mac OS X, Windows, FreeBSD and OpenBSD. This tag is for questions relating to Jenkins version 2.x. For non version-specific questions, please use the [jenkins] tag.

This tag is for questions relating to Jenkins version 2.x. For non version-specific questions, please use the tag.


The Jenkins project started life as in 2004, but the user and developer community decided to rename the project to Jenkins in early 2011 after asserted trademark claims to the name Hudson (see for questions related to the previous name).

Jenkins lets you automate many tasks, such as compilation, tests and deployments. Jobs can be scheduled using cron-like scheduling, or using triggers, such as whenever a source code repository is updated.

Jenkins is Java-based and recent versions require Java 7 (or later) on the master. The Jenkins master can manage multiple build nodes (slaves). Jobs can be run across multiple machines in order to perform jobs in parallel, distribute load, or build and test cross-platform software. Capacity can be easily added — Jenkins can automatically set up a new build slave on any SSH-accessible machine; it can even launch new machines to run jobs on, e.g. via cloud-computing or virtualisation plugins.

Jenkins supports a long list of plugins in a wide variety of categories to support different source control systems, run specialised build tools, send notifications, provide build reports and analytics, customise build workflows, etc. Many are hosted as open source under the Jenkins organisation on GitHub.

Jenkins is an open-source project with an enhanced enterprise product managed by CloudBees. The open source software is hosted on GitHub and distributed under the MIT license. There is an active development community with public documentation, getting started tutorials and a wiki. A new version is released approximately once a week, with more stable "long-term support" releases roughly every 12 weeks.

With its 10th anniversary Jenkins 2.0 was released in April 2016 and has some enormous changes:

  • Pipeline support out of the box
  • Better UI experience with dynamic pages
  • More plugins are bundled to prevent the paradox of choice

With version 2.0 the weekly release plan was reintroduced.

123 questions
87
votes
6 answers

How to invoke a jenkins pipeline A in another jenkins pipeline B

I have two Jenkins pipelines, let's say pipeline-A and pipeline-B. I want to invoke pipeline-A in pipeline-B. How can I do this? (pipeline-A is a subset of pipeline-B. Pipeline-A is responsible for doing some routine stuff which can be reused in…
Yash
  • 2,944
  • 7
  • 25
  • 43
49
votes
3 answers

Compare Spinnaker with Jenkins 2.0 as a continuous delivery tool

As we know, Jenkins 2.0 has been released, and it is extending beyond just continuous integration (CI) to continuous delivery (CD). So I want to ask, what are the competitive advantages of Spinnaker compared to Jenkins 2.0?
feihujiang
  • 577
  • 1
  • 4
  • 5
42
votes
1 answer

Error: "Expected named arguments" in parallel in Jenkins groovy script

I have a Jenkins 2.0 pipeline, with a groovyscript like this: node('nnh561.raijin') { stage 'checkout' build('trunk/checkout') stage 'build' parallel( { build('trunk/build/gfortran') }, { build('trunk/build/ifort')…
naught101
  • 18,687
  • 19
  • 90
  • 138
34
votes
3 answers

Jenkins: Trigger Multi-branch pipeline on upstream change

I am currently testing the pipeline approach of Jenkins 2.0 to see if it works for the build environment I am using. First about the environment itself. It currently consists of multiple SCM repositories. Each repository contains multiple branches,…
Nitram
  • 6,486
  • 2
  • 21
  • 32
32
votes
4 answers

How to trigger a Jenkins 2.0 Pipeline job from a GitHub pull request

It looks like the GitHubPullRequestBuilder is not compatible with Jenkins v2.0 pipeline jobs. How do you configure a pipeline job to be triggered from a GitHub pull request event? The documentation on this topic is sparse and I cannot find any…
user6253266
  • 563
  • 2
  • 5
  • 7
30
votes
2 answers

Jenkins delete jobs when branch deleted via branch-indexing

Is there a way to tell Jenkins (2.2) to remove jobs for branches that were deleted? Currently my build-monitor fills up with branches as the jobs are not deleted. Is there a setting to trigger this behavior or should this be filed as a bug?
ligi
  • 39,001
  • 44
  • 144
  • 244
30
votes
3 answers

Cannot use readMavenPom in Jenkinsfile

I am working on a Jenkinsfile for use with Jenkins 2.0. The readMavenPom method is not recognized. Is there some configuration I am missing to make this available? My Jenkinsfile: node { stage 'Checkout' checkout scm env.PATH = "${tool…
oillio
  • 4,748
  • 5
  • 31
  • 37
24
votes
5 answers

How to set GitHub commit status with Jenkinsfile NOT using a pull request builder

We have Jenkins 2 set to build every push to GitHub, and we do not use the Pull Request builder (although commits that are part of a pull request obviously will get built, as well). The GitHub Integration Plugin says that it only works with the pull…
dcrosta
  • 26,009
  • 8
  • 71
  • 83
24
votes
8 answers

Jenkinsfile get current tag

Is there a way to get the current tag ( or null if there is none ) for a job in a Jenkinsfile? The background is that I only want to build some artifacts ( android APKs ) when this commit has a tag. I…
ligi
  • 39,001
  • 44
  • 144
  • 244
23
votes
2 answers

Jenkins Pipeline Fails if Step is Unstable

Currently my pipeline fails (red), when a maven-job is unstable (yellow). node { stage 'Unit/SQL-Tests' parallel ( phase1: { build 'Unit-Tests' }, // maven phase2: { build 'SQL-Tests' } // shell ) stage…
michaelbahr
  • 4,837
  • 2
  • 39
  • 75
22
votes
1 answer

Maven installation settings not showing in Jenkins

I have just installed Jenkins 2.6 (as a fresh install) but I can't seem to find the Maven installation options. Previously I would just be able to go to Jenkins configuration and in the Maven section there would be an option for MAVEN_HOME and to…
thewire247
  • 795
  • 1
  • 9
  • 24
21
votes
2 answers

How to execute a command in a Jenkins 2.0 Pipeline job and then return the stdout

Is there a better way to run a shell task in a Jenkins 2.0 pipeline and then return the stdout of the command. The only way I can get this to work is to pipe the output of the command to a file and then read the file in to a variable. sh('git…
19
votes
4 answers

Read interactive input in Jenkins pipeline to a variable

In a Jenkins pipeline, I want to provide an option to the user to give an interactive input at run time. I want to understand how we can read the user input in the Groovy script. I'm referring to this documentation. After some trials I've got this…
Yash
  • 2,944
  • 7
  • 25
  • 43
18
votes
1 answer

Jenkins git fetch timeout

I am running Jenkins 2.0 on my Mac OS X Mavericks machine at work. I'm trying to pull down a repository from an internal server. However, the job hangs on the git fetch call for 10 minutes and then times out. If I manually run git clone or git…
Colin Basnett
  • 4,052
  • 2
  • 30
  • 49
14
votes
1 answer

How to add build parameters to jenkins multibranch pipeline?

I would like to add additional build parameters to my jenkins mutibranch pipeline job. Relevant versions: org.jenkins-ci.plugins:script-security:1.19 org.kohsuke:groovy-sandbox:1.10 org.jenkins-ci.main:jenkins-war:2.0 …
Jotschi
  • 3,270
  • 3
  • 31
  • 52
1
2 3
8 9