使用 Ant 或类似工具进行自动化部署
我想梳理一下我们的部署过程,我希望使用Ant或类似的构建工具来设计和实现特定SVN修订版到多个服务器的一键部署。
我们使用 ColdFusion 作为我们的应用程序服务器,因此我们通常只是将一组更改的文件上传到我们的所有服务器。没有编译步骤。
该过程如下:
- 从 SVN 获取特定修订版并将其导出到临时目录 将
- 目录中的所有文件复制/FTP 到一组 Web 服务器
- 根据测试/登台/生产等的需要切换部署目标
- 。将来我们想在此过程中添加数据库模式更改
是否可以使用 Ant 来完成此操作,或者是否有更好的开源工具来完成这项工作?我对 SVN 集成特别感兴趣。
我很想听听这方面的任何经验。提前致谢。
I want to sort out out our deployment process and I was hoping to use Ant or a similar build tool to design and implement a one-click deployment of a specific SVN revision to multiple servers.
We use ColdFusion as our application server so we usually just upload a set of changed files to all our servers. There is no compile step.
The process would be as follows:
- Get a particular revision from SVN and export it to a temp dir
- Copy/FTP all the files in the directory to a set of web servers
- Switch the deployment destination as required for test / staging / production etc.
- In future we'd like to add database schema changes to this process
Is it possible to do this using Ant or are there better open source tools for the job? I'm interested in SVN intergration in particular.
I'd love to hear any experiences in this area. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,这方面有很多来源:
http://subversion.open.collab.net /articles/IntegratingSubversionIntoYourAntBuild.html
http://ant.apache.org/manual /Tasks/ftp.html 或 http://www.developer.com/ java/print.php/998241
另外,我不确定 Cold Fusion 世界中的等效项是什么,但您应该研究单元测试和 linting 工具。 linting 工具可以检查无效的语法和基本结构。无效的语法部分是关键......因为如果出现问题,您可以停止任务,而不是部署已知损坏的代码。
只需设置各个目标(任务)并按正确的顺序将它们串在一起即可。
Yes, there are numerous sources on this one:
http://subversion.open.collab.net/articles/IntegratingSubversionIntoYourAntBuild.html
http://ant.apache.org/manual/Tasks/ftp.html or http://www.developer.com/java/print.php/998241
Also, I'm not sure what the equivalent is in the Cold Fusion world, but you should look into Unit Testing and a linting tool. A linting tool can check for invalid syntax and basic structures. The invalid syntax part is key.. because you can have the task stop if there's a problem as opposed to deploying known-broken code.
It's just a matter of setting up the individual targets (tasks) and stringing them together in the right order.
如果您准备好学习一点,我建议您切换到 Maven 和朋友。 Maven 基本上使得整个开发、测试、部署和管理变得非常简单和可靠。
有一些插件可以在整个过程中为您提供帮助。 SVN 与 Maven 集成,因此您不会遇到任何问题。
以下是简短列表
If you are ready for a bit of learning, I would suggest you to switch to Maven and friends. Maven is basically makes the whole develop, test, deploy and manage very simple and reliable.
There are plugins that are going to help you in the whole process. SVN is intergrated with Maven so, you would not have any issues.
Here is short list