我如何传递参数从詹金斯Ant脚本?

问题描述:

对于一些GUI测试我创建了每个GUI模块詹金斯任务来进行测试。
一旦创建我使用Ant来构建这些测试,但我不知道如何真正从詹金斯参数传递给Ant构建文件?基本上,我该怎么做变量替换的蚂蚁?

For some GUI testing I'm creating a Jenkins task for each GUI module to be tested. Once created I'm using Ant to build these tests, but I'm not aware of how to actually pass parameters from Jenkins to Ant build file? Basically how do I do variable substitution in Ant?

我使用的是SAHI公司的框架来测试GUI组件,所以流程是这样的...

I'm using the Sahi framework to test GUI components, so the flow goes like this...

&詹金斯RARR; Ant构建脚本和RARR; SAHI文件来执行

Jenkins → Ant build script → Sahi file to execute

任何人都可以请它来看​​看?

Can anyone please take a look at it?

使用蚂蚁-Dname =值,可以为Ant命令行属性定义的值。 http://ant.apache.org/faq.html#passing-cli-args

"Using ant -Dname=value lets you define values for properties on the Ant command line." http://ant.apache.org/faq.html#passing-cli-args

要当你调用任何使用$使用詹金斯参数作为变量{} VARIABLENAME

To use a jenkins parameter as a variable when you call any use ${variablename}

https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build