capistrano/capistrano

Stage dependency requirement should check all specified tasks for a stage rather than just the first one

Open

#1,735 创建于 2016年7月24日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)Ruby (1,750 fork)batch import
discuss!help wantedneed more infonew feature

仓库指标

Star
 (12,952 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Rationale

On rare occasions it is necessary call tasks before the stage definition file is loaded. For example, I have a task that sets the AWS_REGION and needs to be executed before the stage file is loaded.

Actual behavior

Capistrano checks the first task called to see if it's a stage or a default task. If it is not, the stage dependency message is emitted.

Requested behaviour

Capistrano should only complain about the stage not being set if there is not one (and only one) stage task called anywhere in the top level tasks.

Notes

If this restriction is lifted, there is a chance that users could misuse capistrano by issuing commands like cap deploy production. This would probably result in an error instead of a helpful error message. Alternately it might be possible to add a dependency on a task that removes the stage dependency.

贡献者指南