Skip to content

Instantly share code, notes, and snippets.

@jaymecd
Created November 14, 2013 22:42
Show Gist options
  • Save jaymecd/7475621 to your computer and use it in GitHub Desktop.
Save jaymecd/7475621 to your computer and use it in GitHub Desktop.
capistrano custom multistage task
# 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