bee
bee copied to clipboard
Use Site Aliases to run 'bee' commands on local and remote sites according to site alias definitions
Site Aliases is a significant feature of Drush and Brush. It allows you to execute commands on a remote backdrop installation. To also allows you to use rsync to move files between installations.
I'm not sure about this... If it turns out to be fairly simple to implement, then maybe. But if it's too complex, then I think it's better left for Drush.
I think leaving this for Drush is not really an option.
If we could get https://github.com/backdrop-contrib/bee/issues/190 done, then we could create an add-on module called bees or swarm or hive that expands it to include more of the commands from drush.
This was raised in today's discussion at Backdrop LIVE. Names were recommended by @keiserjb (bees), @TheMetMan (swarm), and @indigoxela (hive).
Module's adding their own commands is already possible. So have at it!
We had a useful discussion at Backdrop Live on what, if it is to be included, site alias functionality would look like. For reference, here are the notes.
Config
- Could be stored inside site root (or in parent?) or globally?
- Bee will need to be able to find it; might be easier in site root than globally (
~/.bee/aliasesOR~/path/to/localsite/bee/aliases) though if config fully defines the path, then shouldn't be an issue. - D7 stores in PHP (@jenlampton shared some examples - https://gist.github.com/jenlampton/04551c0f51a4f11802d9eeb24e3b854e)
- D8+ stores in yaml (https://gist.github.com/jenlampton/19930dc977a83a61568d07adfdd8d381 / https://gist.github.com/jenlampton/1ce1f554960750e834f68cb5079da48a)
- Brush uses php (https://github.com/backdrop-contrib/brush/blob/1.x-1.x/mysite.aliases.brushrc.php)
- I don't think yaml is right for bee as backdrop doesn't use it. Perhaps json or php? (e.g.
sitename.jsonorsitename.php). PHP may be easier if usingbrushas a template.
Usage
- Recommend using the @ sign to denote an alias using the pattern @[site_name].[environment] globally or @[environment] when in site folder. Additional example of @[pantheon].[site_name].[environment] - this might need a bee/terminus interface.
- There is a desire to be able to run this anywhere in the system and have it act on whichever site/environment combination is given but also should work from site folder. EDIT - I'm not sure this would work with tools like Lando/DDev/Docksal as need to be within the 'app' folder to act on a particular site when
beeis installed as part of the app tooling. beeshould recognise this as a global argument that can operate any commands- It would be good if the config could use SSH configs (i.e. from
~/.ssh/config) and use the hostname rather than having to re-specify the SSH details. Don't know whetherdrushdoes this or not?
Reference
- Drush code
- Brush code
- Drush documentation
- Drush example alias file contents
- Drush aliases guide on Drupal.org
- NOTE - suggestion that
brushcode may be easier as a pattern as is much shorter.
@jenlampton @oadaeh @hosef (@Wylbur - I know you couldn't make it, but I know you have an interest in this) - let me know if I've summarised this correctly or not.
@BWPanda - FYI