Last active
December 18, 2017 15:17
-
-
Save freme/50d6263b25ca199f718b8b2f3d6ad732 to your computer and use it in GitHub Desktop.
minimal Jenkinsfile to show that when directive does not prevent stage from being executed, only the steps, which means that the agent is still needed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline{ | |
agent none | |
stages{ | |
stage('linux') { | |
when { expression {false} } | |
agent { label 'default' } | |
steps { echo 'LINUX' } | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Console Output | |
Started by user Admin | |
[Pipeline] stage | |
[Pipeline] { (linux) | |
[Pipeline] node | |
Running on jenkins-agent-default in /jenkins_agent/workspace/example-pipeline | |
[Pipeline] { | |
Stage 'linux' skipped due to when conditional | |
[Pipeline] } | |
[Pipeline] // node | |
[Pipeline] } | |
[Pipeline] // stage | |
[Pipeline] End of Pipeline | |
Finished: SUCCESS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment