Skip to content

Commit

Permalink
Document the usage of --drall-group option
Browse files Browse the repository at this point in the history
  • Loading branch information
jigarius committed Mar 1, 2022
1 parent 01c8b8a commit 3e2f4f0
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,49 @@ drush @ralph.local st --fields=site
Here, `@@site` is replaced with site names detected from various site alias
definitions.

## Site groups

Drall allows you to group your sites so that you can run commands on such
groups with ease.

```
drall exec --drall-group=GROUP core:rebuild
```

Here's how you can create site groups.

### With site aliases

In a site alias definition file, you can assign site aliases to one or more
groups like this:

```yaml
# File: tnmt.site.yml
local:
root: /opt/drupal/web
uri: http://tmnt.com/
# ...
drall:
groups:
- cartoon
- action
```
This puts the alias `@tnmt.local` in the `cartoon` and `action` groups.

### With sites.php

If your project doesn't use site aliases, you can still group your sites using
one or more `sites.GROUP.php` files like this:

```php
# File: sites.bluish.php
$sites['donnie.drall.local'] = 'donnie';
$sites['leo.drall.local'] = 'leo';
```

This puts the sites `donnie` and `leo` in a group named `bluish`.

## Development

Here's how you can set up a local dev environment.
Expand Down
4 changes: 4 additions & 0 deletions src/Commands/ExecCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ protected function configure() {
);

$this->addUsage('core:status');
$this->addUsage('--uri=@@uri core:status');
$this->addUsage('@@site.ENV core:status');
$this->addUsage('--drall-group=GROUP core:status');

$this->ignoreValidationErrors();
}

Expand Down
4 changes: 4 additions & 0 deletions src/Commands/SiteAliasesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ protected function configure() {
$this->setName('site:aliases');
$this->setAliases(['sa']);
$this->setDescription('Get a list of site aliases.');

$this->addOption(
'drall-group',
NULL,
InputOption::VALUE_REQUIRED,
'Site group identifier.'
);

$this->addUsage('site:aliases');
$this->addUsage('--drall-group=GROUP site:aliases');
}

protected function execute(InputInterface $input, OutputInterface $output) {
Expand Down
4 changes: 4 additions & 0 deletions src/Commands/SiteDirectoriesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ protected function configure() {
$this->setName('site:directories');
$this->setAliases(['sd']);
$this->setDescription('Get a list of site directories.');

$this->addOption(
'drall-group',
NULL,
InputOption::VALUE_REQUIRED,
'Site group identifier.'
);

$this->addUsage('site:directories');
$this->addUsage('--drall-group=GROUP site:directories');
}

protected function execute(InputInterface $input, OutputInterface $output) {
Expand Down

0 comments on commit 3e2f4f0

Please sign in to comment.