legacy-cli icon indicating copy to clipboard operation
legacy-cli copied to clipboard

cli can't find project root on platformsh

Open yobottehg opened this issue 6 years ago • 1 comments

Drush9 dropped remote to remote connections for sql-sync and rsync.

So for syncing dbs and so on we need to connect to the remote first on run the commands from there. See : https://github.com/drush-ops/drush/issues/3408

For this to work we need to create the drush aliases on the servers which is not possible atm because platformsh is not able to find the project root on the platformsh server.

web@1234567890-master-123456--backend:~$ platform drush-aliases
                  
[RootNotFoundException]                                                      
Project root not found. This can only be run from inside a project directory.

I see 2 possiblities here:

  • allow -p parameter for drush aliases so we specify the project directly.
  • change the function LocalProject::getProjectRoot() to not only search for the .git directory.

The goal is to be able to do this for example: lando drush @project.branch1 sql-sync @project.branch2 @self

Any chance to get some feedback on this?

yobottehg avatar Apr 11 '18 08:04 yobottehg

It'll never be a "project" root, because while you're on a platform.sh shell you're inside one app on one environment. So the solution has to be a bit different.

Can Lando just use the CLI to sql/sync between two environments from the outside? Either platform sync data (to sync all data in all services from the parent env) or:

platform db:dump -e SOURCE_ENV -o | platform sql -e DEST_ENV

pjcdawkins avatar Apr 14 '18 10:04 pjcdawkins