如何配置詹金斯为了使用蚂蚁和定制args设置为项目建设 [英] How to configure Jenkins in order to build project using ant and custom args

查看:271
本文介绍了如何配置詹金斯为了使用蚂蚁和定制args设置为项目建设的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有太多的日常建设与利用蚂蚁的下一个项目版本。该例程是必须运行Ant任务之前,可以编辑几个属性的文件。我看了看詹金斯作为一个系统进行构建(包括夜间的),但我有更改属性的问题。

There's too much routine with building next project version using ant. The routine is in several properties files that must be edited before running ant task. I took a look at Jenkins as a system to make builds (including night ones) but I have a problem with changing properties.

是否有可能(如果是,我怎么能做到这一点),以构建之前,为了输入詹金斯配置参数,他们将被传递到蚂蚁?

Is it possible (if yes, how can I do it) to type parameters in Jenkins configuration before build in order they will be passed to ant?

我真正的意思是下面的架构(我用于手动版本):

What I really mean is the following schema (I used in manual builds):


  • 有是包含有关Build版本SRC目的地,电子邮件的数据来通知有关新版本等等。2属性文件

  • there're 2 properties files that contain data about build version, src destination, emails to notify about new build and so on.

相应的属性'键在Ant任务和使用这些属性之前的版本。手动修改

corresponding properties' keys are used in Ant tasks and these properties are changed manually before build.

一些属性是由Java的UTIL阅读并用于构建过程中自己的一部分。

some properties are read by Java util and used for their own part during build.

有是也3或4,一个build.xml文件中的蚂蚁进口XML的,而这些XML的也提到文件中读取属性。

there're also 3 or 4 ant XMLs that a imported in build.xml, and these xmls also read properties from mentioned files.

我想要做的是:


  • 在詹金斯改变关键属性

  • change key properties in Jenkins

preSS构建项目

我的数据会在属性文件中覆盖数据,或为蚁瓦尔值直奔蚂蚁的任务(S)将被通过。

my data will overwrite data in properties files OR will be passed as ant vars values straight to the ant's task(s).

作为一个结果,我收到相应的通知,新的版本(他们是通过蚂蚁制造)

as a result I receive new build with corresponding notifications (they're made through ant)

是否有机制,允许一个通过詹金斯使这种模式的工作?

Are there mechanisms that allow one to make such schema work via Jenkins?

感谢您提前。

推荐答案

在詹金斯,您可以使用参数化建设功能来指定那些你需要替换成你的编译参数。

In Jenkins, you can use the parameterised build feature to specify those parameters you need to substitute into your build.

例如,如果指定一个名为服务器和,当点击现在建,你输入测试参数 ,构建将与您可以访问称为一个环境变量来执行 $ {服务器}

For example, if specify a parameter called server and, when clicking "Build Now", you enter test, the build will be executed with an environment variable you can access called ${server}.

然后,在你的调用Ant打造一步,如果你preSS <大骨节病>高级... ,这揭示了一个属性字段。在这里,您可以输入 my.ant.property = $ {服务器} 。结果
这相当于调用蚂蚁-Dmy.ant.property = $ {服务器} ,并且将扩大到蚂蚁-Dmy.ant.property =测试

Then, in your "Invoke Ant" build step, if you press Advanced..., this reveals a "Properties" field. Here you can enter my.ant.property=${server}.
That's equivalent to calling ant -Dmy.ant.property=${server}, and will be expanded to ant -Dmy.ant.property=test.

这篇关于如何配置詹金斯为了使用蚂蚁和定制args设置为项目建设的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆