Permalink
Browse files

Auto-detect stages.

This will automatically find any stage definitions and prepare tasks
for them, if the :stages variable is not already set.
  • Loading branch information...
1 parent 52dc54a commit d172f95fd08dfe3e1409c5ee04cdb917584e0a2c @jamis jamis committed Jun 14, 2008
Showing with 9 additions and 1 deletion.
  1. +5 −0 ChangeLog
  2. +4 −1 lib/capistrano/ext/multistage.rb
View
@@ -1,3 +1,8 @@
+*unreleased*
+
+* Made multistage module autodetect stages. [Jamis Buck]
+
+
*1.2.0* (July 6, 2007)
* Added multistage as a packaged staging option. [Jamis Buck]
@@ -3,9 +3,12 @@
end
Capistrano::Configuration.instance.load do
- stages = fetch(:stages, %w(staging production))
location = fetch(:stage_dir, "config/deploy")
+ unless exists?(:stages)
+ set :stages, Dir["#{location}/*.rb"].map { |f| File.basename(f, ".rb") }
+ end
+
stages.each do |name|
desc "Set the target stage to `#{name}'."
task(name) do

0 comments on commit d172f95

Please sign in to comment.