configuration-as-code-plugin/demos/mesos
Joseph Petersen 782f87e8cd
docs prettier formatting & cleanup (#831)
2019-04-17 12:55:25 +02:00
..
README.md docs prettier formatting & cleanup (#831) 2019-04-17 12:55:25 +02:00

README.md

configure mesos plugin

sample configuration

jenkins:
  clouds:
    - mesos:
        checkpoint: false
        credentialsId: "MESOS_CREDENTIALS"
        declineOfferDuration: 600
        description: "My Mesos Cloud"
        frameworkName: "Jenkins Framework"
        # jenkinsURL is a mandatory field, Jenkins fails without it. See https://github.com/jenkinsci/configuration-as-code-plugin/issues/578
        jenkinsURL: "https://jenkins.mesos.cloud"
        master: 1.2.3.4:8000
        nativeLibraryPath: "/usr/lib/libmesos.so"
        onDemandRegistration: true
        principal: "MESOS_PRINCIPAL"
        role: "*"
        slavesUser: "jenkins"
        slaveInfos:
          - labelString: "docker"
            containerInfo:
              type: "DOCKER"
              dockerImage: "cloudbees/java-with-docker-client:latest"
              networking: "BRIDGE"
              dockerForcePullImage: false
              volumes:
                - containerPath: "/var/run/docker.sock"
                  hostPath: "/var/run/docker.sock"
                  readOnly: "false"
                - containerPath: "/tmp/jenkins/workspace/"
                  hostPath: "/tmp/jenkins/workspace/"
                  readOnly: "false"
            slaveCpus: 0.1
            slaveMem: 512
            executorCpus: 0.1
            executorMem: 128
            diskNeeded: 0.0
            minExecutors: 1
            maxExecutors: 2
            remoteFSRoot: "jenkins"
            jvmArgs: ""
            jnlpArgs: ""
            defaultSlave: true
            idleTerminationMinutes: 5
            slaveAttributes: >
              {"rack":"jenkins-build-agents"}              

implementation note

Jenkins singleton doesn't offer any setClouds method. So here we rely on a pseudo-property implemented by a dedicated Attribute to add the configured clouds to Jenkins.clouds. The current implementation only adds the configured cloud if it doesn't exists yet.