Capistrano single file deployment

Capistrano single file deployment

Sometimes it happens, that you make a change in one of your project files, because you forgot something. But now you do not want to create a completely new release, because it is not necessary for just one file. The deployment gem capistrano offers a good possibility for removing your problem.

Assumed you changed your 'app/controllers/application_controller.rb' and your deployment process works with capistrano, then you can execute the following steps:


1. Step (file upload)

	cap deploy:upload FILES='app/controllers/application_controller.rb'

2. Step (restart of the application)

	cap deploy:restart


I think with this way it is really easy to avoid initializing a completely new release process. In some cases a completely new release maybe could be better, but in little projects, for example, it works very fine this way.

Matthias Frick
Ruby on Rails
6 Kommentare

Über den Autor

Matthias Frick
Matthias Frick, MSc.

Er ist ein langjähriger Ruby-on-Rails Entwickler und leitet das Unternehmen Frick-Web.

6 Kommentare zu "Capistrano single file deployment"

  1. Tom
    Tom 30.08.2011
    Thanks for your hint. This is exactly what i need.
  2. John R.
    John R. 07.09.2011
    Good to see a talent at work, nice post.
  3. Tom
    Tom 16.11.2011
    Use: cap deploy:upload FILES='app/controllers/*' to upload all files in a directory. Greetings Tom
  4. Matthias Frick
    Matthias Frick 16.11.2011
    Thanks Tom, very cool!
  5. Michael
    Michael 27.02.2012
    Danke für den Artikel. Den ruf ich sicher 10 mal in einem Monat auf weil beim deploy oftmals nur eine Datei ändern muss. Weiter so.
  6. Ashwin Saval
    Ashwin Saval 27.05.2013
    Thanks a ton..Magic when you have to upload that simple marketing page to production :)

Kommentar verfassen