platformsh / legacy-cli

This is the legacy version of Platform.sh's command-line interface. The new version is at: https://github.com/platformsh/cli
https://docs.platform.sh/administration/cli.html
MIT License
222 stars 121 forks source link

Add support for drush aliases without a clone of the project #563

Open yobottehg opened 7 years ago

yobottehg commented 7 years ago

We use the bitbucket integration and do not want to use platform get to clone the source code from platform because of convenience.

It would be great if we were able to generate drush aliases for all environments without cloning the project before.

pjcdawkins commented 7 years ago

OK, that sounds possible and useful.

yobottehg commented 7 years ago

Perhaps we should extend this to a more general approach. Currently the platformsh integration with bitbucket together with platformsh-cli is missing some basic features like drush aliases, variables etc.

IMHO we could resolve almost all if the detection of the document root for a platformsh project is not bound to the platform getcommand but detects the .platform.app.yaml.

With this approach almost all bitbucket integration issues could be resolved.

pjcdawkins commented 7 years ago

Just FYI in the meantime, the detection is based on either:

  1. A file named .platform/local/project.yaml containing id: yourProjectId
  2. A Git remote named origin or platform, which is a Platform.sh project Git URL

So it isn't totally dependent on platform get - you can work around the problem with:

export git_url=$(platform project:info -p yourProjectId git)
cd path/to/your/project
git remote add platform $git_url
yobottehg commented 7 years ago

I just tried the approach from 1. and it works. Would perhaps be good to document that and / or extend the Drupal 8 example?