Created
November 14, 2013 22:42
-
-
Save jaymecd/7475621 to your computer and use it in GitHub Desktop.
capistrano custom multistage task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NB! must be loaded after [require 'capistrano/ext/multistage'] | |
namespace :multistage do | |
desc "List available stages" | |
task :list, :except => { :no_release => true,:stages => true } do | |
print "#{stages.join(',')}\n" | |
end | |
end | |
# overload config to allow stage listing w/o selected stage | |
if callbacks[:start] | |
idx = callbacks[:start].index { |callback| callback.source == 'multistage:ensure' } | |
callbacks[:start].delete_at(idx) | |
on :start, 'multistage:ensure', :except => stages + ['multistage:prepare', 'multistage:list'] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment