Open jameswilson opened 7 months ago
I just realized there is a workaround for my specific use case where the drall group is the same as the site alias.
drall exec drush @@site.prod st
Which begs the question, how should the drall groups in drush aliases files really be used?
If you want to use Drush Aliases in a Drall command, then you need to specify @@site.prod
. For example:
drall exec drush @@site.prod st
Now, to call that command on *.prod
, you need to define the groups in each .site.yml
file like you've already done. Next, use the following command:
drall exec --drall-group=prod drush @@site.prod st
If this doesn't work, please let me know.
When you run a drall exec drush
command without any Drall placeholders, Drall rewrites the command as follows:
drall exec drush --uri=@@dir st
The @@dir
then takes the value of each item in $sites
, e.g. array_values($sites)
. In order to use Drush aliases, you must specify @@site.prod
in your command.
Furthermore, please consider checking out the --drall-filter
parameter which might give you some more flexibility in choosing target sites.
Problem Statement
In a multisite Drupal 10 setup, when executing
drall
from a developer's local environment, I want a way to execute remote drush commands for all sites in a specific server environment via drush aliases *.sites.yml files.Example Use Case
Get super user password reset links for all PROD sites.
Expected Results
A list of password reset links for each domain grouped into the "prod" drall group via drush aliases *.sites.yml files.
Actual Results
Got error output:
Steps to reproduce:
Drupal 10 multisite.
Drush aliases files for each site, each with entries for local, dev, test, and prod environments.
drush/sites/site1.site.yml
A single sites.php file with each domains pointing to its appropriate directory name.
Note: It is critical to have all domains pertaining to a single site in one single file, as opposed to creating different files for each environment sites.local.php sites.dev.php sites.test.php sites.prod.php). Furthermore, we cannot depend on sites.prod.php because our PROD environment supports various subdomain clones like
www.site1.example.com
site1.oembed.example.com
site1.example.com
site1.com
.Proposed resolution
Before erroring out due to missing sites.GROUP_NAME.php file also scan all drush site aliases files containing drall groups defined that match the GROUP_NAME.