我想使用Jenkinsfile在Jenkins从机上执行Ant。我尝试在从机上配置Ant工具,但没有成功。请参阅附件和代码作为参考。
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..."
}
}
}