Tools installation best practices

Issue

It is normal to have various types of agents with different OS (linux, windows, …) and most of the time we will need to install some tools on them required by the build process.

Below are different approaches to manage and maintain the necessary tools in a simple way regardless of the type of agent.

Environment

Resolution

As example, we are going to use the Maven tool installation to show the different alternatives. These methods should work in the same way with other Tool installation

In Jenkins, it’s possible to create a Tool and add different installers. Depending on the installer selected, Jenkins will act differently.

Installing directly from Apache

If your nodes are able to connect to Apache and download the required tool, then you just need to use the Install from Apache installer

Install automatically from Apache

And Jenkins will automatically init the download and install the Maven tool in the agent, no matter the type of agent.

Note: have in mind that Apache installer only will be available for Apache tools. Other tools may not have this kind of installer

Installing with custom installers

Sometimes the previous solution is not enough because of different reasons:

  • There is not connectivity between agents and Apache downloads
  • The tools requires some customization

In both cases, you will need to prepare a bundle of the tool and store it in an internal repository accesible. In this case, you can use the Extract *.zip/*.tar.gz installer

Install automatically from zip/tar.gz

or if you need some extra customization, use the Run Batch Command/Run Shell Command installer.

Install automatically from Batch/Shell command

If both cases you can use the label field to filter in which agent each installer can be used.

Important The labels in the agent and installer have to match. That means that the windows installer will be used in agents which contains the label windows, otherwise you can expect errors installing the tool.

References

Have more questions?

0 Comments

Please sign in to leave a comment.