-
Notifications
You must be signed in to change notification settings - Fork 15
Automatically generate drush aliases #140
Comments
Yeah, should be fine! Just need to write the alias files into the correct places. Something like this manifest: |
Thanks! Okay, well, for a start, let's figure out what the alias file needs to look like. I reckon something like this should suffice: <?php
$aliases = array();
// @TODO For each directory within the parrot sites directory:
$basename = 'mysite.drupal'; // i.e. the current site's directory name.
$prefix = '/webroot'; // Only or sites that use a webroot sub-directory.
$aliases[$basename] = array(
'uri' => 'https://' . $basename,
'root' => '/vagrant_sites/' . $basename . $prefix,
'php' => '/usr/bin/php7.1', // Unless .parrot-php7.0 or .parrot-php5 exist
'local' => TRUE, // Required to avoid double-calling, see https://github.com/drush-ops/drush/issues/1870
);
// (endforeach) I'm guessing |
(I realise that doesn't exactly match the per-site alias files templates in your link, but it's a start.) |
Put them in different files, then it'll be much easier to manage with Puppet. |
So... how would I translate https://github.com/computerminds/puppet/blob/master/custom_modules/cm_serverbase/manifests/components/php/drush_alias.pp into something for parrot? e.g.:
|
Naming things is hard, but it should probably sit somewhere within
You'll want one for each user that we use in Parrot, so probably the
Yes.
Indeed we will. |
Honestly, I don't really know! Other than me, the only other CM person to run into needing this was Ross, and I think he ended up solving his problem another way anyway, after trying various combinations of this flag. |
Presumably it wouldn't do any harm to have this in there? |
Well, it could do. These aliases inside parrot would be new, so there's nothing existing to break. Whereas aliases in our default puppet config already exist on servers, so unless we know they're broken, I'm concerned about changing them with something like this that really could change their operation. |
Okay, happy to leave until it appears to be a valid fix for something. |
Fix owner & group of vagrant user’s alias file too.
Oops, totally hadn’t tested the previous commit.
Maybe each provisioned Drupal site could get a drush alias generated? This would be particularly useful for projects that you have ssh into parrot to be able to run drush commands. (e.g. those requiring versions of PHP that your host machine doesn't have - in my case, PHP 7.1.)
If this is a non-starter for some reason, I can accept that. Otherwise, if some pointers towards how to achieve it could be provided, pretty please, maybe I can make this happen?
The text was updated successfully, but these errors were encountered: