Jenkins管道不尊重代理商规范

时间:2017-10-06 21:41:13

标签: jenkins jenkins-pipeline

在管道级别,我指定代理和节点(包含标签和自定义工作区)。当管道启动时,它会在指定的节点上运行,但是当它遇到“构建作业”时。选择第一个可用节点。我尝试使用NodeLabel插件,但这也没有用。

这是我的Jenkinsfile

pipeline {
    agent {
       node {
            label "Make Build Server"
            customWorkspace "$Workspace"
       }
    }
    options {
       skipDefaultCheckout()
    }
    stages {
        stage('PreBuild'){
            steps{
                input 'Did you authenticate the server through all the firewalls?'
            }
        }
        stage('Housekeeping'){
            steps{
                build job: 'Housekeeping'
            }
        }
    }
}

1 个答案:

答案 0 :(得分:1)

当您在Jenkins文件中使用with tf.variable_scope('model_1'): model one declaration here ... with tf.variable_scope('model_2'): model one declaration here ... with tf.variable_scope('model_3'): model one declaration here ... 指令时,它告诉jenkins您想要构建一个完全独立的作业。 其他作业需要指定它将构建的代理程序。如果它是基于Jenkinsfile的作业,那么其他Jenkins文件将指示代理。如果这是一个自由式工作,同样。所以你期望的事情 - 另一个工作建立在你在"父Jenkins文件中指定的代理上 - 是合理的,但不是它的工作方式。

希望这有帮助!