Neel
Neel

Reputation: 47

single file git deployment into server

I'm using Capistrano for deployment 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.

Upvotes: 3

Views: 1949

Answers (3)

tvial
tvial

Reputation: 612

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.

Upvotes: 0

doritostains
doritostains

Reputation: 1196

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

Upvotes: 11

Andrew Aylett
Andrew Aylett

Reputation: 40700

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...

Upvotes: 2

Related Questions