How to manage build tools on Client masters

Issue

  • You want to know the best way to manage build tools on Client masters

Environment

  • CloudBees Jenkins Operations Center

Resolution

There are three ways to do this. We are showing for all the options how to do it for the JDK, but you can actually do it in the same way for other build tools like Maven.

Option 1: Use a Miscellaneous configuration container to push the build tools [Recommended option]

The way you can use a Miscellaneous configuration container to push tools from CJOC instance to the Client masters is explained on our Shared Configuration section.

Basically, you need to create a new Miscellaneous configuration container from Operations Center dashboard [New Item -> Miscellaneous configuration container].

Then, configure the tools you want to push on the Slaves - I am showing how to do this with the JDK:

Shared configuration for JDK

And now the JDK is pushed from CJOC to Client masters. As you can see at job level this build tool is available.

Job JDK list

However, this feature needs Operations Center Context Plugin >= 1.7.1. If you are using CloudBees Jenkins Operations Center 1.580 base line, the feature was also backported to version 1.6.9 of the plugin. So you might need to upgrade this plugin to have available this feature.

Option 2: Define tool locations on shared slaves from Node Properties->Inject Node Properties

You can specify the location of certain tools at shared node level, although you may prefer to use automatic tool installers instead, removing the need to configure each node separately.
This approach is documented on our official documentation.
To use this approach you need to do the following:

  1. Define the Build tool in CJOC http://<CJOC_URL>/configure - In this example I am showing you how to do it with the JDK.

JDK definition on CJOC

  1. Inject the tool location in the shared slave

Now, you need to define the Properties at shared node level. For this, go to the corresponded shared slave, then Properties -> Inject Node Properties -> Tools locations and select the tool you have defined in the previous section  - 7u51 in this case.

Inject JDK into Node properties

 3. Define the same tool name in Client master Global configuration

Tool Locations will add/update the tool locations. The required tool installers must be defined with the same names both on CJOC and on the client masters to which slaves will be leased.

Go to the Client master global configuration http://<CLIENT_MASTER_URL>/configure and in the JDK section define a JDK with the same name you did in section 1 and 2 - 7u51.

JDK definition on CM

Now, in the client master at job level the JDK we have defined is available on the path we specified at shared node level.

Job JDK list in CM

Note that this option requires to have installed at least -Operations Center Server Plugin_ >= 1.7.2

3. Define the build tool only at Client master level

This option is the less recommended because you not only need to define the tool location per node, but also need to define everything for each client master. With the previous approach you are able to overright this from CJOC->shared slave. 

For this option, you need to define the build tool location in the Client master global configuration http://<CLIENT_MASTER_URL>/configure.

JDK config in CM

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.