我有一个列表变量,我想循环,我可以做到这一点,但我似乎不能调用它在我的 bat 语句,你知道如何?
def birds = ["Parrot", "Cockatiel", "Pigeon"]
pipeline
{
agent any
stages
{
stage('Build Job1')
{
steps
{
script
{
for (int i = 0; i < birds.size(); ++i)
{
echo "Testing the ${birds[i]} browse"
bat 'echo ${birds[i]}'
}
}
}
}
stage ('Hello')
{
steps
{
script
{
for (int i = 0; i < birds.size(); ++i)
{
echo "Testing the ${birds[i]} browser"
}
}
}
}
}
}
1条答案
按热度按时间vnzz0bqm1#
如下所示更改批处理语句。只需用双引号括起来。