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/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/composer.json b/template/composer.json index 5670e01c3..5f4a110fd 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 4fbfc3dfd..4cf7fe41f 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.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..283c069c8 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' + # 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' 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..7ef9a8167 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] @@ -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. 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'; }