In my pipeline, I am changing from my master to a slave node in one of my stages:
pipeline {
agent any
stages {
stage('Install Deps...') {
steps {
echo 'Do something here'
}
}
stage('Build') {
steps {
echo 'Build stuff here...'
stash includes: 'dist/**/*', name: 'builtSources'
node('Protractor') {
dir('/some-dir/deploy') {
unstash 'builtSources'
}
}
}
}
stage('Tests') {
steps {
parallel (
"Chrome": {
echo 'Chrome testing here...'
}
)
}
}
}
}
I can see from the console output on Jenkins it correctly says 'running on master' at the start of the first stage, and changes to 'running on Protractor' in my second stage. When the third 'Tests' stage starts, I dont see the node change back to master in the console output, is that expected behaviour?
Should stages run on the master unless explicitly told otherwise with a node() block?
you have a nested node. This should be equivalent to:
node {
//run stuff on any node
node('agent'){
//run stuff on agent; other node is still busy
}
//return to original node; no message since it is still open
}
//outside of all nodes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With