How do you upgrade / update web java project at your clients?
Let say we are developing a new client/server Java web application. We finally released 1.0 version and sold to few clients. Clients deployed our project on their own at their servers. 开发者_如何学运维After some time we found a few bugs and we would like to update our application.
Is there any framework / technology / pattern / library / server that can help in developing app that can update itself automatically including such steps:- copying new project release
- undeploying old release
- deploying new release
- updating db
At the moment we have vpn to our clients and we are doing all above steps manually. Is it possible to synchronize our clients version with our repositiory?
For the DB part, you can use liquibase. Liquibase is a maven plugin/lib to manage database migrations (upgrading your database to more recent versions). One way to do this with liquibase is to deploy a special servlet that will inquire a schema-table that contains the current db version.
If you can perform a remote deploy (eg: via tomcat admin interface or any other), you can always set up a custom script that performs the deploy for you. You can then offer this script to the client so they can apply the updates following their own schedule.
I don't recommend immediately rolling out updates to clients whenever they are available simply because they (and you) may not want to update them immediately.
The technology you are talking about is an installer. And application installer frameworks exist.
However, when you application stores important state in a database or whatever, automating the migration of the data is tricky and risky ... and next to impossible to do in the context of a generic installer product. The same is true if your application can be customized by your customers. (There is always a chance that the customization will break your automated migration code.)
Now, if the steps that you currently perform manually are straightforward, and don't need to be adapted for different customer sites, then automation may be possible. But you need to make sure that you have a bomb-proof mechanism for backing up the customer's current installation and data and (if necessary) restoring it when your automated upgrade procedure fails.
JavaWebstart can help to deploy the client, but if the database also needs an upgrade, I don't think it can be done safely unless all clients are closed.
精彩评论