Hudson 部署插件 - 多个 Tomcat 服务器
我正在尝试做什么:
有一项 hudson 作业要求用户选择 tomcat 服务器 ip 来部署 war 文件。
我做了什么:
我创建了一个参数化的 hudson 作业“projectname-deploy”,要求用户选择要部署(开发、暂存、实时)war 文件的服务器。在 Hudson 的部署插件字段“Tomcat URL”中,我提供了 http://${SERVER}:8080/ -- SERVER 是包含服务器 IP 的参数字段。但是,${SERVER} 不会被用户选择的 IP 地址替换。
关于如何将战争部署到用户选择的 tomcat 服务器有什么建议吗?谢谢!
What I am trying to do:
Have one hudson job that asks the user to select the tomcat server ip to deploy the war file.
What I have done:
I created a parameterized hudson job "projectname-deploy" that asks the user to select the server to deploy (dev, staging, live) the war file. In Hudson's deploy plugin field "Tomcat URL" I provided http://${SERVER}:8080/ -- SERVER is the parameter field that contains server IP. However, ${SERVER} is not getting replaced with the ip address the user selected.
Any suggestions on how to get a war deployed to the user selected tomcat server? thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我最终使用curl命令来部署war而不是war插件——服务器名称是类型选择的构建作业参数,因此用户可以选择要部署构建的服务器。
我发现这个线程Tomcat管理器远程部署脚本很有帮助
I ended up using the curl command to deploy the war instead of the war plugin-- server name is build job parameter of type choice, so user can choose what server to deploy the build.
I found this thread Tomcat manager remote deploy script helpful
您可以为开发、登台和实时使用不同的配置文件,并根据下拉选择激活配置文件。
假设您在名为 ENVIRONMENT 的参数化作业中创建了一个选择,其中包含选择 dev、staging 等。然后您可以在 pom 中拥有像这样的配置文件...
然后您可以根据需要使用该属性来部署到您需要的位置。
You could use different profiles for dev, staging and live and activate the profile based on the dropdown selection.
Lets say you had create a choice in the parameterized job called ENVIRONMENT with the choices dev, staging etc. Then you could have profiles in the pom like this...
you can then use the property as you wish to deploy to where you need to.