问题
I am running Jenkins pipline (on Jenkins v2.58) and am trying to get the build to run on a slave not the master. Yet, whatever magic I try in the Jenkinsfile, Jenkins keeps running on master.
How do I specify a slave executor?
Here is my toy Jenkinsfile, if that helps:
pipeline {
agent {
node {
label='CentOS7'
}
}
stages {
stage('Creating tox virtual environment') {
steps {
sh 'uname -a'
sh 'tox -v --recreate'
}
}
}
}
回答1:
The right syntax appears to be:
pipeline {
agent { label 'CentOS7' }
stages {
stage('Creating tox virtual environment') {
steps {
sh 'uname -a'
sh 'tox -v --recreate'
}
}
}
}
Also, make sure your master is running.
来源:https://stackoverflow.com/questions/43733917/run-pipline-on-slave-not-master