Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Stage dependency requirement should check all specified tasks for a stage rather than just the first one #1735
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.
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.
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.
If this restriction is lifted, there is a chance that users could misuse capistrano by issuing commands like
You addressed the first idea when you mentioned
Could you elaborate on what set of circumstances lead to this?
The stage file dynamically detects the servers present within a region that are part of the stage based on instance tags, but the region needs to be set so it can properly determine which one to use. I'm trying to setup our system so that I can replicate the same setup in two different regions (for disaster recovery purposes).
Alternative @olbrich if you know that you're always going to need this
(If I remember Rake correctly, this "reopens"
We have a method that will list all stages, so rather than enumerate one line per stage, you could call this and set the prerequisite in a loop.
You might also be able to hook here with something like: