使用 Maven、SVN 和 Hudson(jenkins) 发布

发布于 2024-12-11 09:34:08 字数 434 浏览 0 评论 0原文

我想做一个“发布”,其含义与 Maven 发布插件所假定的含义略有不同。

我有一个网络项目(我想“发布”),它依赖于也由同一个哈德森构建的各种其他项目(尽管不是作为模块)。

“发布”应该执行以下操作:

  • 通过 hudson 构建所有依赖项^依赖项项目
  • 构建 Web 项目(向 MANIFEST 添加递增版本号)
  • 将 Web 项目部署到 tomcat(这已经在常规构建中)
  • 创建一个新标签包括 svn 位置的版本号 x
  • 复制之前构建到新标记的项目的所有当前 svn/head 源代码,
  • 将所有涉及项目的所有 pom 版本更改为 ${versionNumber}.0.1-SNAPSHOT SVN /head

我认为这是每个人都必须做的事情,只是很难通过谷歌找到实际的解决方案。

I would like to do a "release" that has a slightly different meaning from the one that the Maven release plugin assumes.

I have a web project (that I would like to "release") that depends on various other projects that are also build by the same hudson (not as modules though).

The "release" should do the following:

  • build all dependend^dependend projects via hudson
  • build web-project (adding an incrementing version number to MANIFEST)
  • deploy web-project to tomcat (this is already in the regular build)
  • create a new tag that includes version number at svn location x
  • copy all current svn/head sources of projects that where previously build to the new tag
  • change all pom versions of all involved projects to ${versionNumber}.0.1-SNAPSHOT on SVN /head

I figure this is something everyone must be doing, it's just very hard to find the actual solution via google.

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

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

发布评论

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

评论(2

物价感观 2024-12-18 09:34:08

如果您有特定需求,那么我认为实现它们的最简单方法是使用脚本。
多种脚本语言可以用作 Hudson 中的构建步骤。

If you have specific needs, then I think the easiest way to achive them is with scripting.
Several scripting languages can be used as build steps in Hudson.

只有影子陪我不离不弃 2024-12-18 09:34:08

听起来很像我们的要求。我们还没有在 Jenkins 中完全构建它。

因此,我们有以下程序:

  1. 宣布代码冻结,以使所有团队能够在主干中拥有“正确”的代码,并使代码彼此“同步”。

  2. 我们运行一个(自制的)java 工具来检查代码,为发布和发布标签创建分支。从下一次迭代开始,它还将使用新的快照版本更新主干。该工具有自己的配置文件,因此它知道版本号是什么/将是什么以及需要更新哪些项目(以及它们所在的位置)。

  3. 我们运行“构建发布”工作,该工作几乎与我们所有内部企业存储库脱节(它只知道第三方和外部存储库)。该作业清除本地 Maven 存储库(它有自己的存储库,没有其他作业使用)。我使用每个项目的 subversion-tag-parameter 和一个附加的 Mega-project pom 下载所有项目特定的子文件夹(我们需要在作业中配置它),它将所有下载的项目声明为模块(需要转到根文件夹) 。这项工作还完成所需的所有打包工作(压缩静态内容、将来自不同项目的静态文件组合到一个存档中,...)。

  4. 部署

  5. 功能测试

到目前为止2有它自己的工作,3是完全自动化的,我们只需要手动启动它即可。 CI 的第 4 步正在进行中,CI 的第 5 步已计划进行。第 4 步是发布过程中自动化(即使只是部分)的热门候选。

我希望这对您有一点帮助,并给您一些想法。

Sounds pretty much like our requirements. We haven't build that completely out in Jenkins yet.

So we have following procedure:

  1. announce code freeze to enable all teams to have the 'right' code in trunk and to have the code in 'sync' with each other.

  2. We run a (home grown) java tool that checks out the code creates the branches for the release and the release tags. starting next iteration it will also update trunk with the new snapshot version. The tool has it's own config files so that it knows what the version numbers are/will be and what projects (and where they are located) need to be updated.

  3. We run our 'build release' job, which is pretty much disconnected from all our internal enterprise repos (it only knows about the third party and external repos). The job cleans out the local maven repo (it has it's own repo that no other job uses). I downloads all our projects specific subfolders (we need to configure that in the job) using the subversion-tag-parameter for each and a additional Mega-project pom, which declares all downloaded projects as modules (needs to go to the root folder). This job also does all the packaging needed (zipping static content, combining static files from different projects into one archieve, ...).

  4. deployment

  5. functional testing

So far 2 has it's own job and 3 is completely automated, we just need to start it manually. Step 4 is in the works for CI and Step 5 is planned for CI. Step 4 is a hot candidate to be automated (even if it is just in parts) for the release process.

I hope that helps a little bit and gives you a few ideas.

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