Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does :except => {:no_release => true} mean in Capistrano DSL

Tags:

For example in:

 task :restart, :roles => :app, :except => { :no_release => true } do  end 
like image 402
denysonique Avatar asked Oct 31 '11 22:10

denysonique


1 Answers

Looking at the handbook, it appears that you can pass the :no_release attribute to the role definition (commonly done for the web role). This indicates that the code should not be checked out on servers in that role.

So, I'm guessing that when a task specifies :except => { :no_release => true } - it's saying "Skip this task on the servers (roles) that have :no_release defined as true."

role :app, "your app-server here" role :web, "your web-server here", :no_release => true role :db,  "your db-server here", :primary => true 

...

desc "restart passenger" task :restart, :except => { :no_release => true } do   run "touch #{current_path}/tmp/restart.txt" end 

In the above example, the restart operation should not run on the web server. Again, this is not tested... just going by my observations.

like image 90
davekaro Avatar answered Nov 30 '22 19:11

davekaro