I have following Jenkinsfile, where I want to run the stage on 3 nodes. I have used && operator as per this answer.
pipeline{
agent {
label 'webserver && serverex && composeserver'
}
stages{
stage('run this on 3 nodes'){
steps{
script{
sh 'echo $HOSTNAME'
}
}}
}}
However I'm gettting following error.
There are no nodes with the label ‘webserver&&serverex&&composeserver’
The above stage is an example, I have multiple scripts under the same stage.
I can achieve this using parallel but it will be repetitive as I need to run it on 3 nodes.
May I know what is wrong with AND (&&) operator? Was it removed from Jenkins as it looks like it is working before as per the answer mentioned in the link?