如何组织Java Web应用程序的临时部署?

发布于 2024-11-19 15:42:25 字数 387 浏览 5 评论 0原文

我们有一个 Java Web 应用程序,以及许多使用它的开发人员。每个开发人员都在自己的分支中使用自己的功能。当功能准备就绪时 - 我们想要对其进行审查并进行直观测试(当然,在所有单元和集成测试都通过之后)。我们希望自动化此部署过程。理想情况下,我们希望让我们的开发人员只需在某处单击一个按钮即可将应用程序部署到 http://example.com/staging/branches/foo (其中 branches/foo code> 是开发人员在 SVN 存储库中的路径)。

然后,部署会被审核(主要由项目发起人审核),合并到 /trunk 中,并从临时服务器中删除。

我认为我不是第一个需要实现这种场景的人。有哪些工具和技术可以帮助我?

We have a Java web app, and a number of developers working with it. Every developer is working with his/her own feature, in its own branch. When the feature is ready - we want to review it and visually test (after all unit and integration tests are passed, of course). We want to automate this process of deployment. Ideally, we would like to let our developers click just one button somewhere to make the application deployed to http://example.com/staging/branches/foo (where branches/foo is developer's path in SVN repository).

Then, the deployment is reviewed (by project sponsors mostly), merged into /trunk, and removed from the staging server.

I think that I'm not the first one who needs to implement such a scenario. What are the tools and technologies that may help me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

旧情勿念 2024-11-26 15:42:25

通常,我会使用阶段环境来测试“主干”(即一个版本的所有单独分支合并在一起)。造成这种情况的几个原因:

  • 利益相关者和发起人通常没有时间测试各个分支。他们想要测试整个版本。对于非直接团队内部的人员来说,跟踪不同的、不断变化的 URL 并理解为什么功能 X 在一个 URL 上工作而在另一个 URL 上不起作用,往往会变得非常困惑。对于您的赞助商来说,始终保持简单。
  • 为了进行适当的阶段测试而维护多个第三方依赖项(数据库、服务提供商等)实例往往会变得非常混乱且成本高昂。请记住,您希望始终维护真实的测试数据。
  • 在将所有单独的分支合并在一起发布之前,将会出现冲突和集成错误。假设自动化集成测试并不完美。

话虽如此,有很多用于自动构建/部署的好工具。在不了解有关构建设置和部署环境的任何情况下,标准设置可能包含构建服务器、maven 和 tomcat。构建服务器将执行构建并将生成的应用程序部署到测试服务器。如果您使用 maven 和 tomcat,有一个插件可用于此任务 (http: //mojo.codehaus.org/tomcat-maven-plugin/introduction.html)。有许多优秀的构建服务器以及对 Maven 的良好支持。 Teamcity 很受欢迎,Hudson CI

Typically, I would use a stage environment to test the "trunk" (ie all the individual branches for a release merged together). Several reasons for this:

  • Stakeholders and sponsors usually don't have time to test individual branches. They want to test the entire release. It also tend to get very confusing for people not inside the immediate team to keep track of different, changing URLs and understanding why feature X works on one URL and not the other. Always keep it simple for your sponsors.
  • It tends to become very messy and costly to maintain more than one instance of third-party dependencies (databases, service providers etc) for proper stage testing. Bear in mind that you want to maintain realistic test-data at all times.
  • Until you merge all individual branches together for a release, there will be collisions and integration bugs that will be missed. Assume that automated integration tests won't be perfect.

All that being said, there are lots of good tools for automatic build/deploy out there. Not knowing anything about your build setup and deployment environment, a standard setup could consist of a build-server, maven and tomcat. The build-server would execute the build and deploy the resulting appplication to the test-server. If you are using maven and tomcat, there is a plugin available for this task (http://mojo.codehaus.org/tomcat-maven-plugin/introduction.html). There are a number of good build-servers out there as well with good support for maven. Teamcity is popular, as is Hudson CI.

独闯女儿国 2024-11-26 15:42:25

基本上你可以使用Hudson/Jenkins。

有多种方法可以使用一些插件来管理一台计算机上的多个部署,如下所述 在 Jenkins 用户上发帖,您只需管理这些多个部署成为开发人员正在处理的分支。

正如 @pap 所说,Hudson 和其他 CI 软件构建、测试(如果您有任何测试)并部署 Web 应用程序,您只需配置此过程即可。希望该链接有帮助。

Basically you can use Hudson/Jenkins.

There are ways to manage have multiple deployments on one machine with some plugins, as stated on the following post on Jenkins Users, you'll just have to manage those multiple deployments to be the branches the developers are working on.

As @pap said, Hudson and other CI software build, test (if you have any tests in it) and deploy webapps, you'll just have to configure this procedure. Hope the link is helpful.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文