使用 TeamCity 构建和部署特定修订版号
我刚刚开始掌握 TeamCity 和 MSDeploy,并且部署到由 SVN 提交触发的开发环境运行良好。我的问题是关于发布到测试环境;我想根据特定的修订号按需执行此操作。根据用户定义的修订版配置 TeamCity 构建的最佳方法是什么?
I'm just getting to grips with TeamCity and MSDeploy and have deployment to a dev environment triggered by SVN commit working nicely. The question I have is in terms of releasing to a test environment; I want to do this on demand and based on a specific revision number. What's the best way to configure a TeamCity build based on a user-defined revision?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 TeamCity 中的固定功能。您可以固定某个版本,然后部署最新的固定版本。
因此,您在 TeamCity 中有一个“创建开发构建”任务,该任务部署到开发环境并公开工件。您可以在 TeamCity 中创建另一个任务,该任务将使用“创建开发构建”任务中最新固定构建的工件并部署到您的测试环境。
您可以创建另一个任务,将其部署到生产最新固定的“测试”版本。只需取消最后固定的构建即可实现回滚。
您还有部署构建的历史记录。
Take a look on Pin functionality in TeamCity. You can pin a certain build and then deploy latest pinned build.
So you have a 'Create development build' task in TeamCity which deploys to dev environment and exposes artefacts. You can create another task in TeamCity that will use artefacts from latest pinned build in 'Create development build' task and deploy to your testing environment.
You can create yet another task that deploys to production latest pinned 'test' build. Rollback can be achieved by simply unpinning last pinned build.
You also have a history of deployed build.
您可以在 TeamCity 中使用运行自定义构建对话框,并自定义有 Changes to include 参数,您需要在其中指定要构建的实际 SVN 版本。
You can use Run Custom Build Dialog in the TeamCity, and customize there Changes to include parameter, where you need to specify actually SVN revision to build.