<p>We are providing Jenkins As a Service using Openshift as orchestration platform in our corporate environment. Different teams use different tools and their version to configure jobs. </p>

<p>For instance, we have 3 different combinations of java and maven. 5 different version of npm, 2 different version of python.</p>

<p>I wanted to know what is the best practice of configuring different tools? </p>

<p>Do I need to create and use slave image for each combination and different version of tool?</p>

<p>Is it a good practice to keep a simple slave image like different jdk versions (1.7, 1.8 etc) and configure JDK, NPM, Maven, Python packages as tools and use a persistent volume on slave. So that, during build these packages are setup on the fly in the PVC. </p>

<p>Is that an anti-pattern to use tools this way in docker slave images?</p>

Shariq Nawaz
<p>I have accomplished this by creating a <code>git</code> repository called <code>jenkins</code> and the structure of the repository looks like</p>

<pre><code>master/
  plugins.txt
  config-stuff

agents/
  base/
  nodejs8/
  nodejs10/
  nodejs12/
  maven/
  java8/

openshift/
  templates/
    build.yaml
    deploy.yaml (this includes the deployment and configmaps to attach the agents)
  params/
    build
    deploy
</code></pre>

<p>We are able to build each agent independently and the master independently. We place the deployment template on the OpenShift cluster so the user has to do <code>oc process openshift//jenkins | oc apply -f -</code> to install Jenkins in a namespace. However, you should also look into <a href="https://helm.sh/" rel="nofollow noreferrer">helm</a> for installing Jenkins as a helm chart.</p>
