Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cbi-dev] Newbie question about new Jenkins – Jenkinsfile and Tools

Hi Jens,

You may be able to use the "migration" agent in your Jenkinsfile with something like

  agent {
    kubernetes {
      label 'wildwebdeveloper-buildtest-pod'
      defaultContainer 'jnlp'
      yaml """
apiVersion: v1
kind: Pod
spec:
  containers:
  - name: maven
    image: maven:3.6.2-jdk11
    tty: true
    command: [ "uid_entrypoint", "cat" ]
  - name: jnlp
    image: 'eclipsecbi/jenkins-jnlp-agent'
    volumeMounts:
    - mountPath: /home/jenkins/.ssh
      name: volume-known-hosts
  volumes:
  - configMap:
      name: known-hosts
    name: volume-known-hosts
"""
    }
  }

And thenm you can switch between the maven and the jnlp containers in your build steps.

Back to the top