capistrano/capistrano

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

Open

#1,735 opened on 2016年7月24日

GitHub で見る
 (3 comments) (0 reactions) (0 assignees)Ruby (1,750 forks)batch import
discuss!help wantedneed more infonew feature

Repository metrics

Stars
 (12,952 stars)
PR merge metrics
 (30d に merged 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.

コントリビューターガイド