From 3e7a83b48392c4921284323cd7a59d5d70390dca Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Thu, 5 May 2016 15:36:12 -0400 Subject: [PATCH 1/4] Improving dev desktop settings.php compatibility. --- template/build/core/phing/tasks/properties.xml | 8 -------- template/docroot/sites/default/settings.php | 9 +++++++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/template/build/core/phing/tasks/properties.xml b/template/build/core/phing/tasks/properties.xml index 7699ee5d6..158606e0f 100644 --- a/template/build/core/phing/tasks/properties.xml +++ b/template/build/core/phing/tasks/properties.xml @@ -19,12 +19,4 @@ - - - - - - - - Using "${db.database}" database diff --git a/template/docroot/sites/default/settings.php b/template/docroot/sites/default/settings.php index 4fbfc3dfd..744f9c325 100755 --- a/template/docroot/sites/default/settings.php +++ b/template/docroot/sites/default/settings.php @@ -732,6 +732,11 @@ * * Keep this code block at the end of this file to take full effect. */ -if ($is_local_env && file_exists(DRUPAL_ROOT . '/sites/default/settings/local.settings.php')) { - require DRUPAL_ROOT . '/sites/default/settings/local.settings.php'; +if ($is_local_env) { + if (isset($_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR']) && file_exists($_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR'] . '/loc_${project.acquia_subname}_dd.inc')) { + require $_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR'] . '/loc_${project.acquia_subname}_dd.inc'; + } + elseif (file_exists(DRUPAL_ROOT . '/sites/default/settings/local.settings.php')) { + require DRUPAL_ROOT . '/sites/default/settings/local.settings.php'; + } } From 245801720782cd6e8117359630099442ab57a25c Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Thu, 5 May 2016 15:40:36 -0400 Subject: [PATCH 2/4] Changing project.acquia_subname to project.machine_name. --- build/phing/build.yml | 2 +- template/composer.json | 2 +- template/docroot/sites/default/settings.php | 4 ++-- template/project.yml | 6 +++--- template/readme/local-development.md | 8 ++++---- tests/phpunit/BoltTest.php | 4 ++-- tests/phpunit/DeployTest.php | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/build/phing/build.yml b/build/phing/build.yml index 94e1f9852..a36aaf477 100644 --- a/build/phing/build.yml +++ b/build/phing/build.yml @@ -1,2 +1,2 @@ bolt: - new.dir: ${bolt.root}/../${project.acquia_subname} + new.dir: ${bolt.root}/../${project.machine_name} diff --git a/template/composer.json b/template/composer.json index 5670e01c3..6a1f35940 100644 --- a/template/composer.json +++ b/template/composer.json @@ -1,5 +1,5 @@ { - "name": "acquia/${project.acquia_subname}", + "name": "acquia/${project.machine_name}", "license": "proprietary", "type": "project", "repositories": [ diff --git a/template/docroot/sites/default/settings.php b/template/docroot/sites/default/settings.php index 744f9c325..4cf7fe41f 100755 --- a/template/docroot/sites/default/settings.php +++ b/template/docroot/sites/default/settings.php @@ -733,8 +733,8 @@ * Keep this code block at the end of this file to take full effect. */ if ($is_local_env) { - if (isset($_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR']) && file_exists($_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR'] . '/loc_${project.acquia_subname}_dd.inc')) { - require $_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR'] . '/loc_${project.acquia_subname}_dd.inc'; + if (isset($_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR']) && file_exists($_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR'] . '/loc_${project.machine_name}_dd.inc')) { + require $_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR'] . '/loc_${project.machine_name}_dd.inc'; } elseif (file_exists(DRUPAL_ROOT . '/sites/default/settings/local.settings.php')) { require DRUPAL_ROOT . '/sites/default/settings/local.settings.php'; diff --git a/template/project.yml b/template/project.yml index 21c1d908a..aa99d5e3b 100644 --- a/template/project.yml +++ b/template/project.yml @@ -1,7 +1,7 @@ project: - # The acquia_subname value is the machine name of your Github repository. # This will determine the the directory name of the new repository. - acquia_subname: 'bolted8' + # Dev Desktop users: this should match your local site name + machine_name: 'bolted8' # Used for enforcing correct git commit msg syntax. prefix: 'BLT' human_name: 'Bolted 8' @@ -25,7 +25,7 @@ git: drush: aliases: # The remote environment from which the database will be pulled. - remote: ${acquia_subname}.test + remote: ${machine_name}.test # The local environment against which all local drush commands are run. local: self diff --git a/template/readme/local-development.md b/template/readme/local-development.md index fafc831d1..1f062aa7b 100644 --- a/template/readme/local-development.md +++ b/template/readme/local-development.md @@ -30,21 +30,21 @@ To use Drupal VM with a Drupal project that is generated with Bolt, first place To make sure Drush commands work correctly with Drupal VM, inside the new project's `build/custom/phing/build.yml` file, override the `docroot` used for Drush commands with the value: drush: - root: /var/www/[project_acquia_subname]/docroot + root: /var/www/[project_machine_name]/docroot Then follow the Quick Start Guide in [Drupal VM's README](https://github.com/geerlingguy/drupal-vm#quick-start-guide), but before you run `vagrant up`, make the following changes to your VM `config.yml` file: # Update the hostname to the local development environment hostname. vagrant_hostname: [project_local_domain] - vagrant_machine_name: [project_acquia_subname] + vagrant_machine_name: [project_machine_name] # Provide the path to the project root to Vagrant. vagrant_synced_folders: # Set the local_path for the first synced folder to `../`. - local_path: ../ # Set the destination to the Acquia Cloud subscription machine name. - destination: /var/www/[project_acquia_subname] + destination: /var/www/[project_machine_name] type: nfs # Set this to `7` for a Drupal 7 site, or `8` for a Drupal 8 site. @@ -52,7 +52,7 @@ Then follow the Quick Start Guide in [Drupal VM's README](https://github.com/gee # Set drupal_core_path to the `destination` in the synced folder # configuration above, plus `/docroot`. - drupal_core_path: /var/www/[project_acquia_subname]/docroot + drupal_core_path: /var/www/[project_machine_name]/docroot # Set drupal_domain to the same thing as the `vagrant_hostname` above. drupal_domain: [project_local_domain] diff --git a/tests/phpunit/BoltTest.php b/tests/phpunit/BoltTest.php index 6f8fbec3b..6c4131c3c 100644 --- a/tests/phpunit/BoltTest.php +++ b/tests/phpunit/BoltTest.php @@ -19,7 +19,7 @@ public function __construct() { $this->projectDirectory = realpath(dirname(__FILE__) . '/../../'); $this->config = Yaml::parse(file_get_contents("{$this->projectDirectory}/project.yml")); - $this->new_project_dir = dirname($this->projectDirectory) . '/' . $this->config['project']['acquia_subname']; + $this->new_project_dir = dirname($this->projectDirectory) . '/' . $this->config['project']['machine_name']; } /** @@ -37,7 +37,7 @@ public function testBoltCreate() { ); $this->assertFileNotExists($this->new_project_dir . '/build/tasks/bolt.xml'); $this->assertNotContains( - '${project.acquia_subname}', + '${project.machine_name}', file_get_contents($this->new_project_dir . '/docroot/sites/default/settings.php') ); $this->assertNotContains( diff --git a/tests/phpunit/DeployTest.php b/tests/phpunit/DeployTest.php index b7f83aacd..bf9390a4a 100644 --- a/tests/phpunit/DeployTest.php +++ b/tests/phpunit/DeployTest.php @@ -18,7 +18,7 @@ public function __construct() { $this->projectDirectory = realpath(dirname(__FILE__) . '/../../'); $this->config = Yaml::parse(file_get_contents("{$this->projectDirectory}/project.yml")); - $this->new_project_dir = dirname($this->projectDirectory) . '/' . $this->config['project']['acquia_subname']; + $this->new_project_dir = dirname($this->projectDirectory) . '/' . $this->config['project']['machine_name']; $this->deploy_dir = $this->new_project_dir . '/deploy'; } From 88040bc351fdfe65e748588d21fe2d79f721fe1c Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Thu, 5 May 2016 17:08:22 -0400 Subject: [PATCH 3/4] Minor text changes. --- template/composer.json | 2 +- template/project.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/template/composer.json b/template/composer.json index 6a1f35940..5f4a110fd 100644 --- a/template/composer.json +++ b/template/composer.json @@ -1,5 +1,5 @@ { - "name": "acquia/${project.machine_name}", + "name": "acquia/${project.machine_name}", "license": "proprietary", "type": "project", "repositories": [ diff --git a/template/project.yml b/template/project.yml index aa99d5e3b..283c069c8 100644 --- a/template/project.yml +++ b/template/project.yml @@ -1,6 +1,6 @@ project: - # This will determine the the directory name of the new repository. - # Dev Desktop users: this should match your local site name + # Everyone: This will determine the the directory name of the new repository. + # Dev Desktop users: this should match your local site name. machine_name: 'bolted8' # Used for enforcing correct git commit msg syntax. prefix: 'BLT' From 26178a7ebd848c5468e616b10f8e21cc2f9b2fe5 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Thu, 5 May 2016 18:06:41 -0400 Subject: [PATCH 4/4] Updating dev desktop documentation. --- template/readme/local-development.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/template/readme/local-development.md b/template/readme/local-development.md index 1f062aa7b..7ef9a8167 100644 --- a/template/readme/local-development.md +++ b/template/readme/local-development.md @@ -86,6 +86,19 @@ Once you've made these changes and completed the steps in Drupal VM's Quick Star Add a new site in Dev Desktop by selecting _Import local Drupal site_. Point it at the `docroot` folder inside your new code base. Your `/sites/default/settings.php` file will be modified automatically to include the Dev Desktop database connection information. +### Drush support + +In order to use a custom version of Drush with Dev Desktop, you must add the +following lines to ~/.bash_profile: + +``` +export PATH="/Applications/DevDesktop/mysql/bin:$PATH" +export DEVDESKTOP_DRUPAL_SETTINGS_DIR="$HOME/.acquia/DevDesktop/DrupalSettings" + +``` + +Restart your terminal session after adding these lines. + ## Alternative local development environments For reasons, some teams may prefer to use a different development environment. Drupal VM offers a great deal of flexibility and a uniform configuration for everyone, but sometimes a tool like Acquia Dev Desktop, MAMP/XAMPP, or a different environment (e.g. a bespoke Docker-based dev environment) may be preferable.