Question on how to go about pushing out our PHP code. Previously, we would simply run our test suite, commit changes, and then svn up on the productions servers to "push" out changes. I'd like to change this because I'm not too comfortable having svn on the production servers for multiple reasons.
I was thinking of just writing a script that does the followings: (would push out from svn server)
- svn export
- Tar and scp new code to production servers.
- ssh to production servers and unpack archive
Obviously overwriting all previous files in the process/cleaning up.
This would be speedy. Any bugs could easily be fixed, committed, and then just re-push the code back out to the servers (or revert a revision, etc). Any comments/suggestions/criticisms to this approach are ap开发者_如何学JAVApreciated. ;)
Exactly what Capistrano does and what I use it for. It's designed for Rails apps, but is easily customizable, with the railsless extension taking care of most parts for you already. It's written in Ruby, but is easy enough to learn.
In our local environment, I had set it up so that when code was committed to trunk (meaning tested, stable code that's ready for web deployment), I had a shell script as the post-commit hook to manage the changed files via FTP.
I'm sure there's much better managed solutions, but that was easiest for me.
精彩评论