-1

We are planning to automate the build system using Hudson. We are new to Hudson or it would be better to say this way that we are new to build automation process. Our application is on Java platform and the database is on MS SQL. This (automation) milestone is break down into different goals. The first step which we have is to automate database changes (DDL/DML) and during updating database if anything goes wrong it should be able to roll back the changes and send an e-mail to a group to notify the failure (with reasons). Otherwise, if succeed then allow to move on to the next step which is make the build and deploy with LiveRebel.

I think we should have a centric mechanism on build failure on any instance if a build fail it should be able roll back changes what it would have had done. For instance, if database changes failed as I said it should notified and don't proceed further. And, if database succeed and build making process failed (e.g because of Unit Tests) it should be able to roll-back the database changes. If notification can have failure details (like exception details with person responsible for this) it would be very helpful to diagnose and inquire appropriately. How can (should) I do this?

We are also interested to use LiquidBase with Hudson.

I would like to ask for your opinion and suggestions how should I plan this and what should be a good way to achieve this.

4

1 回答 1

1

首先,您不应该混淆构建和部署。数据库更新将是您的部署过程的一部分,而不是您的构建过程。即使使用持续集成,这也应该分开。这意味着您在构建项目并运行所有 JUnit 测试后更改数据库。如果在此之前失败,则不应执行更改,因此无需回滚。

至于你的实际问题:我不知道有什么插件可以做你想做的事。在 Hudson/Jenkins 中,您始终可以执行批处理/shell 脚本。编写一个脚本来执行您的更改。如果您的脚本以错误返回码退出,则构建应该会失败。

对于发送构建失败的通知,有各种插件,包括电子邮件。

于 2012-12-26T13:37:26.610 回答