Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add idleMinutes to pod template in declarative pipeline #336

Merged
merged 1 commit into from May 29, 2018
Merged

Add idleMinutes to pod template in declarative pipeline #336

merged 1 commit into from May 29, 2018

Conversation

@tmarcuzz
Copy link
Contributor

@tmarcuzz tmarcuzz commented May 29, 2018

Implement JENKINS-51569

How to use it in a declarative pipeline :

pipeline {
  agent {
    kubernetes {
      label 'myLabel'
      idleMinutes 10
      yaml '''
apiVersion: v1
kind: Pod
metadata:
  labels:
    some-label: some-label-value
spec:
  containers:
  - name: jnlp
    image: myDocker/jnlp:3.7-1-alpine
    args: 
    - ${computer.jnlpmac} ${computer.name}
    tty: true
'''
    }
  }
    stages {
        stage ('myStage') {
            steps {
                script {
                    echo "coucou"
                }
            }
        }
    }
}
Implement [JENKINS-51569](https://issues.jenkins-ci.org/browse/JENKINS-51569)

How to use it in a declarative pipeline :

```
pipeline {
  agent {
    kubernetes {
      label 'myLabel'
      idleMinutes 10
      yaml '''
apiVersion: v1
kind: Pod
metadata:
  labels:
    some-label: some-label-value
spec:
  containers:
  - name: jnlp
    image: myDocker/jnlp:3.7-1-alpine
    args: 
    - ${computer.jnlpmac} ${computer.name}
    tty: true
'''
    }
  }
    stages {
        stage ('myStage') {
            steps {
                script {
                    echo "coucou"
                }
            }
        }
    }
}
```
@carlossg carlossg merged commit d449569 into jenkinsci:master May 29, 2018
2 checks passed
Loading
@tmarcuzz tmarcuzz deleted the patch-1 branch May 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants