bee icon indicating copy to clipboard operation
bee copied to clipboard

Add a bee plugin for Pantheon's Terminus command line tool

Open yorkshire-pudding opened this issue 3 years ago • 7 comments
trafficstars

Discussion during Backdrop Live about hosting Backdrop sites on Pantheon. An integration between bee and terminus was suggested. The way I understand this is it would be a terminus plugin that would run bee commands; this is therefore a placeholder and the resolution may be an update to documentation.

@jenlampton - are you able to elaborate on how this works with drush?

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

https://pantheon.io/docs/terminus/plugins

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

There are a handful of pantheon- drush commands, that will leverage functionality from terminus.

Here's a list from my local setup (with both drush + terminus)

All commands in terminus: (terminus)
 pantheon-aliases      Update the Pantheon Drush alias file at ~/.drush/pantheon.aliases.drushrc.php.         
 (paliases)                                                                                                   
 pantheon-auth         Authenticate against the Pantheon dashboard. Required before doing anything else.      
 (pauth)                                                                                                      
 pantheon-hostname-ad  Add a hostname to a site you control.                                                  
 d                                                                                                            
 (psite-hostname-add,                                                                                         
 psite-ha)                                                                                                    
 pantheon-hostname-li  List all hostnames associated with a site.                                             
 st                                                                                                           
 (psite-hostname-list                                                                                         
 , psite-hl)                                                                                                  
 pantheon-hostname-re  Remove a hostname from a site you control.                                             
 move                                                                                                         
 (psite-hostname-remo                                                                                         
 ve, psite-hr)                                                                                                
 pantheon-logout       Clear any stored session data.                                                         
 (plogout)                                                                                                    
 pantheon-organizatio  Add a site to an organization. Org admins only.                                        
 n-site-add                                                                                                   
 (porg-site-add)                                                                                              
 pantheon-organizatio  Remove a site from an organization. Org admins only.                                   
 n-site-remove                                                                                                
 (porg-site-remove)                                                                                           
 pantheon-organizatio  List the sites for an organization. Org admins only.                                   
 n-sites (porg-sites)                                                                                         
 pantheon-organizatio  List your organization affiliations.                                                   
 ns (porgs)                                                                                                   
 pantheon-pp (pp)      Direct pseudo-proxy interface. JSON only. For debugging.                               
 pantheon-products     Get the list of available Drupal product start-states.                                 
 (pproducts)                                                                                                  
 pantheon-site-attrib  Get attributes for a particular site.                                                  
 utes (psite-attr)                                                                                            
 pantheon-site-backup  List site backups (and exports).                                                       
 s (psite-backups)                                                                                            
 pantheon-site-branch  Create Git branch of master for a particular site.                                     
 -create                                                                                                      
 (psite-bcreate)                                                                                              
 pantheon-site-branch  Delete a Git branch from a particular site.                                            
 -delete (psite-bdel)                                                                                         
 pantheon-site-branch  List Git branches for a particular site.                                               
 -list (psite-blist)                                                                                          
 pantheon-site-change  Change the owner of a site.                                                            
 -owner                                                                                                       
 (psite-change-owner)                                                                                         
 pantheon-site-clone   Clone content from one site environment to another.                                    
 (psite-clone)                                                                                                
 pantheon-site-commit  Commit changes in an on-server-dev environment.                                        
 (psite-commit)                                                                                               
 pantheon-site-connec  Set or retrieve the connection mode of a specific site/environment.                    
 tion-mode                                                                                                    
 (psite-cmode)                                                                                                
 pantheon-site-create  Create a new site on Pantheon                                                          
 (psite-create)                                                                                               
 pantheon-site-dashbo  Get the dashboard link for a site.                                                     
 ard (psite-dash)                                                                                             
 pantheon-site-delete  Delete a site from Pantheon.                                                           
 (psite-delete)                                                                                               
 pantheon-site-deploy  Deploy code to a particular environment.                                               
 (psite-deploy)                                                                                               
 pantheon-site-diffst  Get a list of changes (diffstat) to be commited in a remote on-server-dev environment. 
 at (psite-diffs)                                                                                             
 pantheon-site-downlo  Download a backup file from a specific site.                                           
 ad-backup                                                                                                    
 (psite-dl-backup)                                                                                            
 pantheon-site-enviro  Create a new multidev site environment.                                                
 nment-create                                                                                                 
 (psite-ecreate)                                                                                              
 pantheon-site-enviro  Delete a multidev site environment.                                                    
 nment-delete                                                                                                 
 (psite-edelete)                                                                                              
 pantheon-site-enviro  Get a list of site environments.                                                       
 nment-list                                                                                                   
 (psite-elist)                                                                                                
 pantheon-site-enviro  Lock a site environment.                                                               
 nment-lock                                                                                                   
 (psite-elo)                                                                                                  
 pantheon-site-enviro  Get information about whether a site environment is locked.                            
 nment-lock-info                                                                                              
 (psite-eli)                                                                                                  
 pantheon-site-enviro  Clear redis cache of a site environment.                                               
 nment-redis-clear                                                                                            
 (psite-erc)                                                                                                  
 pantheon-site-enviro  Unlock a site environment.                                                             
 nment-unlock                                                                                                 
 (psite-eul)                                                                                                  
 pantheon-site-get-ba  Get a download link to a specific site backup.                                         
 ckup                                                                                                         
 (psite-get-backup)                                                                                           
 pantheon-site-import  Import an existing site to Pantheon                                                    
 (psite-import)                                                                                               
 pantheon-site-info    Get Pantheon metadata on a site                                                        
 (psite-info)                                                                                                 
 pantheon-site-jobs    Get a list of jobs for a site.                                                         
 (psite-jobs)                                                                                                 
 pantheon-site-load-b  Load db with a backup file from a specific site.                                       
 ackup                                                                                                        
 (psite-load-backup)                                                                                          
 pantheon-site-make-b  Trigger an on-demand backup for a site/environment.                                    
 ackup (psite-backup)                                                                                         
 pantheon-site-mount   Mounts an environment file system to a local directory.                                
 (psite-mount)                                                                                                
 pantheon-site-name    Get the site name from UUID.                                                           
 (psite-name)                                                                                                 
 pantheon-site-notifi  Get a list of notifications for a site.                                                
 cations                                                                                                      
 (psite-notifications                                                                                         
 )                                                                                                            
 pantheon-site-nr-inf  Get New Relic metadata on a site                                                       
 o (psite-nri)                                                                                                
 pantheon-site-servic  Update the service level for the site.                                                 
 e-level                                                                                                      
 (psite-upgrade)                                                                                              
 pantheon-site-team    Get the team for a site.                                                               
 (psite-team)                                                                                                 
 pantheon-site-team-a  Add someone to the team for a site.                                                    
 dd (psite-team-add)                                                                                          
 pantheon-site-team-r  Remove someone from the team for a site.                                               
 emove                                                                                                        
 (psite-team-remove)                                                                                          
 pantheon-site-tunnel  Opens a tunnel to a specific site/environment/service.                                 
 (psite-tunnel)                                                                                               
 pantheon-site-tunnel  Closes the tunnel to a specific site/environment/service.                              
 -close                                                                                                       
 (psite-tclose)                                                                                               
 pantheon-site-tunnel  Get a list of open tunnels.                                                            
 s (psite-tunnels)                                                                                            
 pantheon-site-uuid    Get the site UUID based on the name.                                                   
 (psite-uuid)                                                                                                 
 pantheon-site-wake    Ensure a site environment is online and not suspended due to inactivity.               
 (psite-wake)                                                                                                 
 pantheon-sites        List your Pantheon sites.                                                              
 (psites)

jenlampton avatar Oct 24 '22 18:10 jenlampton

An integration between bee and terminus was suggested.

IMO this shouldn't go into Bee core. Only a minority is using Pantheon, for the majority of Bee users this all would just be dead code.

Bee allows to add custom plugins already, and that's documented in the API readme, so I'm really not sure why this issue has been opened as "feature request".

indigoxela avatar Oct 27 '22 13:10 indigoxela

I opened as a placeholder, but if you see my opening comment, I suggested that the work will probably happen on the terminus side rather than the bee side.

yorkshire-pudding avatar Oct 27 '22 14:10 yorkshire-pudding

This is the source code for the Terminus internal command that executes drush: https://github.com/pantheon-systems/terminus/blob/3.x/src/Commands/Remote/DrushCommand.php

I've tried writing a Terminus plugin that adapts this code but replaces the "drush" command with a php command to execute bee.php, and I've included bee in my git repo pushed to Pantheon. However, I discovered that these remote commands to drush are executed through an ssh tunnel, and it appears that Pantheon restricts what can be executed through an ssh tunnel. Though they allow you to execute 'drush' and 'wp' (Wordpress CLI), they don't allow you to execute 'php'.

This means we'll probably need Pantheon's help to allow Terminus to execute bee. I'm not sure of the best way to go about it. Does anyone have a close relationship with a Pantheor who could help? In the meantime, I've posted a question on Pantheon's slack, but I have no idea if I'll get an answer.

paul-mckibben avatar Aug 29 '23 19:08 paul-mckibben

@irinaz - is this something you can help @paul-mckibben with? If I remember correctly, you have contacts at Pantheon?

yorkshire-pudding avatar Aug 31 '23 08:08 yorkshire-pudding

@yorkshire-pudding , @paul-mckibben , responded in zulip

irinaz avatar Aug 31 '23 18:08 irinaz

Seems to be no interest in any Pantheon users working on this, so going to close so it doesn't clutter up the issue queue.

yorkshire-pudding avatar Jul 31 '24 10:07 yorkshire-pudding