无法在Jenkins从属服务器上执行Ant构建工具

时间:2019-05-09 18:33:07

标签: jenkins jenkins-pipeline jenkins-slave

我想使用Jenkinsfile在Jenkins从机上执行Ant。我尝试在从机上配置Ant工具,但没有成功。请参阅附件和代码作为参考。

enter image description here

pipeline {  

agent any

environment {
    ANT_HOME = tool('MyAnt')
}
stages {
    stage("Build") {
        agent {label 'redhat_slave1'}
        steps {
            echo "Building application..."   
            sh '$ANT_HOME/bin/ant clean'
        }
    }
    stage("Unit Tests") {
        agent { 
            label 'redhat_slave1'
        }
        steps {
            echo "Unit tests (JUnit)..."
            echo "Mutation tests (pitest)..."


        }
    }
    stage("Functional Test") {
        agent { 
            label 'redhat_slave2'
        }
        steps {
            echo "Selenium tests..."
        }
    }

}

0 个答案:

没有答案