Jenkins 与本地 Tomcat 实例交互
我在开发服务器上安装了 Jenkins,以便在我的开发代码库(用 ColdFusion 编写)上运行以下操作:
- 从 Git 中提取任何更改
- 在 Tomcat 上创建新主机?
- 运行所有单元测试
- 如果测试通过,则创建一个 Git 标签来表示测试成功,
- 否则如果测试失败,则通过 IM 我
可以执行所有操作,除了列表中的第二项。我遇到的第一个问题是我不确定最佳实践是什么,在工作区中创建一个新主机或将代码复制到其他地方的目录中。
Jenkins 和 ColdFusion 运行在同一 Tomcat 服务器上; Jenkins 作为 WAR 部署运行,而 Railo (CF) 在 Tomcat 上创建的所有主机上运行,并在其中创建 WEB-INF 目录。
我找到了大量有关将应用程序部署到远程 Tomcat 实例的文档,但找不到有关部署到本地 Tomcat 实例的任何内容,那么我可以从 Jenkins 创建 Tomcat 主机吗?如果是这样,最好的方法是什么?
I have Jenkins installed on my development server to run the following operations on my development codebases (written in ColdFusion):
- Pull down any changes from Git
- Create the new Host on Tomcat?
- Run all Unit tests
- If tests pass then create a Git tag to say that it was successful
- Else if tests fail then IM me
I am able to do everything, except for the second item in my list. The first problem that I have is that I am not sure what the best practice is, create a new host in the workspace or copy the code to a directory somewhere else.
Jenkins and ColdFusion run on the same Tomcat server; Jenkins is running as WAR deployment and Railo (CF) runs on all hosts created on Tomcat, creating a WEB-INF directory there).
I was able to find plenty of documentation on deploying applications to remote Tomcat instances, but I couldn't find anything on deploying to a local Tomcat instance, so can I create Tomcat Hosts from Jenkins? If so what is the best way to do so?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我有一个 Jenkins 实例正在运行,执行大部分相同的操作。我认为一个简单的解决方案是让一个进程将新的主机条目附加到 XML 文件中。由于这是在同一台机器上,所以这应该很容易。您可以使用 CFML 来完成此操作,但是,我尝试将这些流程放入脚本中(我使用 Scala,它具有出色的 XML 功能,并且可以轻松地作为脚本执行),以便它们可以在不依赖于 CFML 引擎的情况下执行。
希望这有帮助。
I have a Jenkins instance running doing much of the same. I think a simple solution would be to have a process append a new Host entry to the XML file. Since this is on the same machine, this should be really easy. You could do this with CFML, but, I try to put these processes in scripts (I use Scala which has great XML functionality and can easily be executed as a script) so they can execute without a dependency on the CFML engine.
Hope this helps.