Bamboo 构建特定的 SVN 修订版

发布于 2024-08-26 10:27:21 字数 702 浏览 4 评论 0原文

想象一下 Bamboo 中有一个项目有两个构建计划:暂存部署 (SD) 和生产部署 (PD)。构建 SD 检查最新的源代码,构建它们并将网站部署到临时服务器。目前,PD 所做的一切都是一样的,即将最新版本的网站部署到生产服务器。显然,这不是很好:我希望能够部署与之前部署在临时服务器上的网站完全相同的版本,而不是最新版本。

为了说明这一点:假设我们位于 SVN 存储库中的 r101 处。单击“构建 SD”会将网站版本(例如 2.1.0.101)部署到登台服务器。现在我们提交了一项重大更改,最终到达 r102。现在我想部署到生产服务器。如果我点击“构建 PD”,Bamboo 会很乐意签出 r102 并构建它,从而将版本 2.1.0.102 部署到生产环境中服务器。

然而,我希望它做的是构建和部署之前在 SD 计划中构建的版本(即 2.1.0.101)。

当然,我可以制定SD计划将最新成功的构建标记为tags/builds/latest,但我宁愿让 Bamboo 自己处理这个问题。

Imagine there's a project in Bamboo with two build plans: Staging Deployment (SD) and Production Deployment (PD). Building SD checks out latest sources, builds them and deploys a web site to a staging server. Currently, PD does all the same, namely deploys the latest version of a web site to a production server. Clearly, this is not very good: I want to be able to deploy the same exact version of a web site that was previously deployed on a staging server, not the latest one.

To illustrate: suppose we're at r101 in SVN repo. Clicking "Build SD" will deploy a web site version, say, 2.1.0.101 to staging server. Now we commit a breaking change and end up at r102. Now I want to deploy to a production server. If I hit "Build PD", Bamboo will happily check out r102 and build it, resulting in version 2.1.0.102 being deployed to a production server.

What I want it to do, however, is to build and deploy a version which was previously built in an SD plan (that is, 2.1.0.101).

Of course I can make SD plan to tag latest-successful build as tags/builds/latest, but I would rather have Bamboo itself handle that.

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

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

发布评论

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

评论(2

你的背包 2024-09-02 10:27:21

在构建命令中,您可以通过选项 custom.svn.revision.number 指定要使用的修订版本。因此,它将类似于 -Dcustom.svn.revision.number=101 进入 PD 计划的配置中。

注意: 为此,您需要 Bamboo v1.1 或更高版本。

From your build command, you can specify the revision to use with the option custom.svn.revision.number. So, it'll be something like -Dcustom.svn.revision.number=101 into the PD plan's configuration.

Note: You need Bamboo v1.1 or later for this.

血之狂魔 2024-09-02 10:27:21

我最终做的是用众所周知的标签(例如“/tags/project-latest”)标记每个成功的暂存部署,然后从该标签构建生产版本。

What I ended up doing is tagging each successful staging deployment with a well-known tag (like, `/tags/project-latest') and then building production build from that tag.

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