bee icon indicating copy to clipboard operation
bee copied to clipboard

Use Site Aliases to run 'bee' commands on local and remote sites according to site alias definitions

Open Wylbur opened this issue 4 years ago • 5 comments
trafficstars

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.

Wylbur avatar Mar 03 '21 00:03 Wylbur

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.

ghost avatar Nov 05 '21 09:11 ghost

I think leaving this for Drush is not really an option.

oadaeh avatar Jul 16 '22 16:07 oadaeh

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).

jenlampton avatar Jul 16 '22 17:07 jenlampton

Module's adding their own commands is already possible. So have at it!

ghost avatar Jul 16 '22 22:07 ghost

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/aliases OR ~/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.json or sitename.php). PHP may be easier if using brush as 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 bee is installed as part of the app tooling.
  • bee should 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 whether drush does this or not?

Reference

@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

yorkshire-pudding avatar Oct 24 '22 10:10 yorkshire-pudding