samrocketman / jenkins-bootstrap-jervis

An automated Jenkins CI environment which provisions agent infrastructure on the fly per build.
Apache License 2.0
75 stars 30 forks source link

Global Tool (specifically Java) Tool Configuration support #10

Closed rpomeroy closed 7 years ago

rpomeroy commented 8 years ago

In typical Jenkins 2.0 Pipeline builds a Jenkinsfile will reference a Java Tool by name. How does one automate the configuration of multiple Global Tool definitions like JDKs, Maven, Ant etc.?

samrocketman commented 7 years ago

I just saw this; sorry for the late response. That would be set up in the toolchains.json. You can learn more about that file by viewing the Specification for toolchains file in the wiki.

So let's say you have the YAML file in the root of the repository the YAML would look like:

language: java
jdk: oraclejdk8

There's more examples in the specification document.


For automating more than one toolchain within a build, it would be a list in the YAML file. It would create a Matrix job type according to this Job DSL script.

e.g.

language: java
jdk:
  - oraclejdk7
  - oraclejdk8

It assumes the toolchains exist on the agent already.

samrocketman commented 7 years ago

I wrote some additional documentation around this. See also: