Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yorkshire-pudding opened this issue Oct 24, 2022 · 7 comments
Open

Comments

@yorkshire-pudding
Copy link
Collaborator

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
Copy link
Collaborator Author

@jenlampton
Copy link
Member

jenlampton commented Oct 24, 2022

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)

@indigoxela
Copy link
Member

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

@yorkshire-pudding
Copy link
Collaborator Author

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.

@paul-mckibben
Copy link

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.

@yorkshire-pudding
Copy link
Collaborator Author

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

@irinaz
Copy link

irinaz commented Aug 31, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants