Run pipline on slave not master

时光毁灭记忆、已成空白 提交于 2019-12-25 09:05:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!