📚 Cheatsheet

Une collection organisée de snippets de code pour accélérer votre développement. Parcourez, recherchez et copiez en un clic.

Snippets 3

Retour
Condition 'when' avec un paramètre
Intermédiaire
stage('Deploy') {
    when { expression { params.RUN_DEPLOY == true } }
    steps { /* ... */ }
}
Condition 'when' sur une branche
Facile
stage('Deploy to Prod') {
    when { branch 'main' }
    steps { /* ... */ }
}
Conditions multiples avec 'allOf' ou 'anyOf'
Avancé
when {
    allOf {
        branch 'main';
        expression { params.ENVIRONMENT == 'production' }
    }
}