开发者

Playframework: Upgrade process -- Best Practices

I'd very much appreciate anyone sharing best-practices, patterns, anti-patterns, backup, rollback processes that you have formulated for a pain-free, foolproof, Play framework upgrade.

I'm thinking just replacing the bin/play directory with the latest version can cause problems

Edit:

I'm looking for more specific version management strategies, say,

a) Do you just have /bin/play directory having the latest play version or 开发者_Go百科b) Do you keep versions like /bin/play-1.1 /bin/play-1.2 and change your $PATH to point to the latest (cons: you have to rebuild your modules, dependencies & libs; pros: gives better control over rollback)


I prefer to install play from source using git:

git clone git://github.com/playframework/play.git
cd play

# checkout specific version
git checkout 1.2.1

cd framework
ant
cd ..
ln -s $PWD/play ~/bin

So I have a full install including all source. Later, when play was updated to version 1.2.2 I did the following:

cd <play_home>
git pull
git checkout 1.2.2
cd framework
ant

In your application you then do

play clean && play run

The advantage of running play from a source build is that you can always and easily roll back to the previous version or even test out features from current development. This does not solve the problem of having multiple versions of play active at the same time though.


I agree with Andre. However, if you are asking for best practice for a live project, I would do it differently.

You can have multiple version installed on your local machine. The only thing you have to change is which one is visible in the path. For instance you could have 1.1, 1.2, 2.0 and depending on which one you want, you just modify your /home/youruser/.bashrc file.

The reason, why simple update of play from git or hg will not work/good idea is because, incase there are problems, you have to revert, rollback modules, or goodness know what not.

It is far better to simple swap out the play version, rebuild, test extensively, once you are ok that everything is good, then you can make the same changes in a live site.

If things don't workout, or your are hopelessly lost, all you have to do is revert the changes to your project and switch the play version. You will be back to where you started.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜