eclipse-cbi / jiro

Jenkins infrastructure for projects hosted by the Eclipse Foundation
Other
10 stars 37 forks source link

Override cpu/memory request and limit from jenkinsfile #374

Closed heurtematte closed 5 months ago

heurtematte commented 5 months ago

This allows merging yaml definition from a JenkinsFile

E.g:

pipeline {
    agent {
        kubernetes {
          inheritFrom 'centos-8'
          yaml """
    spec:
      containers:
      - name: jnlp
        resources:
          limits:
            memory: "3Gi"
            cpu: "2000m"
          requests:
            memory: "3Gi"
            cpu: "2000m"
    """
        }
    }

    stages {
        stage('Main') {
            steps {
                sh 'hostname'
            }
        }
    }
}

According to this issue: https://issues.jenkins.io/browse/JENKINS-70061, webui configuration always overrides yaml configuration.