single file git deployment into server
I'm using Capistrano for deploymen开发者_JAVA百科t of rails application; how can one file be updated on the server without making a new release?
For example :
Suppose I made changes to only my UserController.rb.
and committed it the to git server,
how should I get this update onto the server without making a new deployment.
Capistrano has a deploy task for updating single files where a full deploy isn't necessary.
cap -e deploy:upload
In your case it would probably be like this:
cap deploy:upload FILES='app/controllers/UserController.rb'
You might also have to restart your app
cap deploy:restart
You should make a new release through Capistrano.
The purpose of a deployment tool is to give you repeatable results and to help you to keep track of what you've deployed. Circumventing this process for a small fix means that you lose both of these advantages. If you think that running your whole deploy process for a simple change is overkill, then you should probably work on streamlining the process (or on making sure that you never have to perform a simple fix -- good luck with that!).
Pragmatically, I'm sure many people would just edit the file manually on the server. Not recommended, for the reasons given above. If you think the trade-off is worth it, that's your call :).
As a disclaimer: I'm not a ruby developer and I've never actually used Capistrano, my advice is generic rather than specific to those technologies. Maybe there is a special way to push small changes through the system -- if so, I'd have expected an answer pointing it out...
The task cap deploy:upload
doesn't exist anymore in Capistrano 3.
You can add this gem https://github.com/Reiknistofa/capistrano-upload to get it back.
精彩评论