Skip to content

Commit

Permalink
Backport ACSF improvements from 9.2.x (#3289)
Browse files Browse the repository at this point in the history
* Test against Drupal 8.6.x-dev. (#2937)

* Updating versions of Drupal core and Lightning. (#3061)

* Updating CHANGELOG.md and setting version for 9.2.0-alpha1.

* Fixes #3055: Update memcache settings to match changes in Drupal memcache module. (#3058) (#3067)

* Require drupa/memcache equal or greater than 2.0-alpha7.
* Updating memcache settings based on change in drupal/memcache module.

* Allow PHPUnit to bootstrap from core. (#3071)

* Clarified Git hook documentation. (#3073)

* Finished updating memcache config for alpha7. (#3076)

* Finished updating memcache config for alpha7.
* Locking drupal/memcache to 2.0-alpha7 until memcache stabilizes.

* Updating CHANGELOG.md and setting version for 9.2.0-alpha2.

* Travis CI Memcache Service and Settings (#3082)

* Start memcached service and add php extension.
* Check status of memcached service.
* Use blt memcache config on CI.

* Run simplesaml config command on all composer calls. (#3051)

* Update local-development.md (#3087)

Correcting links to PHPStorm documentation on Acquia's documentation service.

* Remove memcache.yml and references to it. (#3093) (#3094)

* Cherry-pick in lost/abandoned commits from 9.x (#3072)

* VM setup tips (#3036)

* Update local-development.md to reference committing DrupalVM files.

* New guidelines for contribution. (#3045)

* Adding replication and verification step sections and clean up formatting.

* Adding new guidelines for PRs to the CONTRIBUTING docs.

* Fixes #2964: When manually deploying using a tag also push that tag to source repo. (#2992)

* Adding a cutSourceTag method and invoking when deploying tag.

* Set default deploy.tag_source config setting and check it when deploying.

* Refactoring to use a single cutTag method.

* Remove line about expectation you already have a tag on your source before you tag a release.

* Warn if user is creating a tag but tag_source option is false.

* Updating deploy documentation.

* Fixes #3053: Update requirement to drush/drush:^9.4.0. (#3078)

* Fixes #3065: Use webflo/drupal-core-require-dev instead of tracking core dev dependencies. (#3068)

* Use core's PHPUnit bootstrap file. (#3092)

* amotic -> atomic (#3098)

Fixed minor typo in code review docs.

* Support memcache on ACSF via flags. (#3096)

* Remove support for PHPUnit 5. (#3102)

* Run validation without interaction on CI. (#3070) (#3097)

* Fixes #3046: Cleaned up Pipelines docs. (#3104)

* Exclude the 'sites/settings' dir for the default list of sites. (#2994) (#3105)

Force-approving this based on the same code's approval on the 9.x branch.

* Updating CHANGELOG.md and setting version for 9.2.0-alpha3.

* Update config_split.config_split.ci.yml (#3129)

* Update README.md (#3113)

* Minor variable / comment refactor. (#3111)

* Fix the link of Memcache documentation page. (#3135)

* Remove PHP 5.6 from the list of tested versions. (#3137)

* Fixes #2945 by removing cloud hook exception for ACSF. (#2946)

* Fixes #2945: removing exception for cloud hooks on ACSF.
* Cleaning up variable use in db scrub hook.
* Adding ACSF check to post deploy and makes db scrub consistent with others.

* updating blt docs to cover ACSF memcache use. (#3136)

* Fix INSTALL.md installation directions for Drush Launcher. (#3127)

* Fixes #3118: Update theme path to more standardized D8 defaults. (#3119)

* Resolves #3106: Add 'skip_permissions_hardening' setting to local settings file template (#3107)

* Update support policies (#3147)

* Update support policies

* Update README.md

* Fix PHP syntax error in acquia simplesamlphp config. (#3141)

* 3149: Minor grammar fix (#3150)

* Fixed travis output. (#3151)

* Travis shouldn't duplicate Drupal 8.6 tests (#3152)

* Travis should test Drupal 8.7.

* Disable 8.7 tests.

* Updating CHANGELOG.md and setting version for 9.2.0.

* Prevent cache collisions in multisite db-update tasks (#3166)

* Add drush cache dir utility script.

* Enhanced Factory Hook to isolate db-update tasks to tempoary drush cache.

* Update Factory Hooks from BLT template.

* Remove redundant cache clear and rebuild to preserve drush context of current request.

* Style tweaks and setting update version number to 9.2.

* Prevent cache collisions in multisite install tasks (#3171)

* Refactor post-install hook to use temp cache dir per site, use requests instead of ENV.

* Refresh Factory Hooks from template for 9002001.

* Update version number for hook.

* Remove redundant factory hook update.

* Removed unused use statements.

* Style and phpcs updates.

* Update BLT settings for site and http/proxy detection (#3172)

* Fix auto detection of sites dir due to core changes.

* Update proxy and host detection for core updates and Acquia VCL changes.

* PHPCS fixes.

* Update deploy.md with correct Cloud Hooks links. (#3188)

The Acquia docs link pointed to a stale page and the BLT one pointed to the 8.x branch, both throwing 404's. I've updated both to point to the latest iterations of each page.

* Update to Drupal Coder 8.3.x. (#3132)

Fixes #2289 
--------

Changes proposed:
---------
(What are you proposing we change?)

- Update composer contraint on Drupal Coder newest release (8.3.1 as of this date)
- Update composer constraint on squizlabs/php_codesniffer to 3.0.1 (matching Coder)
- Remove the use of a bootstrap file with PHPCS. File paths that are not allowed by filesets won't be sniffed by default.
- Add a tests:phpcs:sniff:modified command to sniff unstaged modified or added files in repo for convenience.

* Updating CHANGELOG.md and setting version for 9.2.1.

* Merge tag '9.1.7' of github.com:acquia/blt

* PHP CS fixes.

* Restrict lightning version constraint to 8.5x.

* Revert coder to older version.

* Revert required and suggested composer merge plugin config.

* Update RoboFile.php

* Fix default drush local multisite alias bug causing test failures.

* Fix multisite test alias bug.

* Revert "Update to Drupal Coder 8.3.x. (#3132)"

fccd0d0

* Update hooks and phpcs config.

* BLT Backport of 9.2 to 9x (#3280)

* Fix comment formatting in PhpUnitCommand. (#3211)

* Fixes #3063 by updating faq and install docs to improve install profile instructions. (#3064)

* [9.2.x] Fix undefined trusted_reverse_proxy_ips #3214 (#3215)

Fixes #3214 
--------

Changes proposed:
---------
(What are you proposing we change?)

- check if trusted_reverse_proxy_ips is defined as an array
- if not, set an empty array

Steps to replicate the issue:
----------
(If this PR is not fixing a defect/bug, you can remove this section.)

1. blt setup
2. bootstrap drupal

Steps to verify the solution:
-----------
(How does someone verify that this does what you think does?)

1. apply the patch
2. blt setup / bootstrap Drupal
3. check to ensure following warning does not appear:

```
Warning: in_array() expects parameter 2 to be array, null given in require() (line 27 of /app/vendor/acquia/blt/settings/blt.settings.php).
require('/app/vendor/acquia/blt/settings/blt.settings.php') (Line: 806)
require('/app/docroot/sites/naswa_main/settings.php') (Line: 125)
Drupal\Core\Site\Settings::initialize('/app/docroot', 'sites/naswa_main', Object) (Line: 1056)
Drupal\Core\DrupalKernel->initializeSettings(Object) (Line: 655)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
```

* Fixes #3185 to bring install and local docs inline. (#3186)

* Fixing updates 9002000 message. (#3205)

* Fixing missing semi-colon at end of line. (#3208)

* Fixes #3243 to clean up dry-run in deploy command. (#3263)

* Multisite bugfixes (#3231)

* Fix multisite test alias bug.

* Fix default drush local multisite alias bug causing test failures.

* Fix global varible scope and phpcs syntax.

* Update variable names and fix phpcs validation errors..

* Add missing phpunit-bridge package.

* Add BLT update hook for 9.1.9 release.

* Update version for 9.1.9 release.

* Revert "Lock core in 9.x branch to 8.5.6. (#3062)"

b2e0bcf

* Use assertions to resolve build failures due to phpunit 'risky tests' notice.

* Revert travis backports to debug build.

* Ensure minimum of dmore/chrome-mink-driver 2.5.0.

* Remove duplicate update hook.

* Removing changes from composer files.
  • Loading branch information
grasmash authored and mikemadison13 committed Dec 14, 2018
1 parent c2e07ee commit eaa3940
Show file tree
Hide file tree
Showing 33 changed files with 301 additions and 94 deletions.
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ env:
- IS_PULL_REQUEST=$TRAVIS_PULL_REQUEST
- BUILD_DIR=$TRAVIS_BUILD_DIR
- DRUPAL_CORE_HEAD=8.5.x-dev
- DRUPAL_CORE_STABLE=8.5.6
matrix:
- DRUPAL_CORE_VERSION=$DRUPAL_CORE_STABLE PHPUNIT_EXCLUDE_GROUP='long,requires-vm'
- DRUPAL_CORE_VERSION=$DRUPAL_CORE_STABLE PHPUNIT_GROUP='long' PHPUNIT_EXCLUDE_GROUP='requires-vm'
- DRUPAL_CORE_VERSION=default PHPUNIT_EXCLUDE_GROUP='long,requires-vm'
- DRUPAL_CORE_VERSION=default PHPUNIT_GROUP='long' PHPUNIT_EXCLUDE_GROUP='requires-vm'
# - DRUPAL_CORE_VERSION=$DRUPAL_CORE_HEAD

matrix:
Expand All @@ -35,6 +34,9 @@ cache:
- "$HOME/.nvm"
- "/tmp/blt-sandbox-instance/.rules"

services:
- memcached

addons:
ssh_known_hosts: []
chrome: stable
Expand All @@ -44,6 +46,8 @@ before_install:
- source ${BLT_DIR}/scripts/travis/exit_early
# Decrypt private SSH key id_rsa_blt.enc, save as ~/.ssh/id_rsa_blt.
- if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then openssl aes-256-cbc -K $encrypted_c0b166e924da_key -iv $encrypted_c0b166e924da_iv -in id_rsa_blt.enc -out ~/.ssh/id_rsa -d; chmod 600 ~/.ssh/id_rsa; ls -lash ~/.ssh; eval "$(ssh-agent -s)"; ssh-add ~/.ssh/id_rsa; fi
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sudo service memcached status
- phpenv config-rm xdebug.ini
- phpenv config-add travis.php.ini
- composer self-update
Expand Down Expand Up @@ -86,4 +90,4 @@ deploy:
on:
branch: $DEPLOY_SOURCE_BRANCH
php: 5.6
condition: $DRUPAL_CORE_VERSION = default
condition: $DRUPAL_CORE_VERSION = default
3 changes: 3 additions & 0 deletions PATCHES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches)
Patches applied to this directory:

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"doctrine/common": "^2.5",
"doctrine/inflector": "~1.1.0",
"drupal/coder": "^8.2.11",
"drush/drush": "^9.3.0",
"drush/drush": "^9.4.0",
"grasmash/drupal-security-warning": "^1.0.0",
"grasmash/yaml-cli": "^1.0.0",
"grasmash/yaml-expander": "^1.2.0",
Expand Down
1 change: 1 addition & 0 deletions composer.required.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"jarnaiz/behat-junit-formatter": "^1.3.2",
"se/selenium-server-standalone": "^2.53",
"jakoch/phantomjs-installer": "2.1.1-p07",
"dmore/chrome-mink-driver": "^2.5.0",
"dmore/behat-chrome-extension": "^1.0.0",
"mikey179/vfsStream": "~1.2",
"symfony/phpunit-bridge": "^3.4.3",
Expand Down
1 change: 0 additions & 1 deletion composer.suggested.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
}
},
"require": {
"acquia/drupal-spec-tool": "^2.0.0",
"acquia/lightning": "^3.1.0",
"drupal/acquia_connector": "^1.5.0",
"drupal/acquia_purge": "^1.0-beta3",
Expand Down
4 changes: 2 additions & 2 deletions config/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ drush:

git:
# The value of a hook should be the file path to a directory containing an
# executable file named after the hook.
# Changing a hook value to 'false' will disable it.
# executable file named after the hook. Changing a hook value to 'false' will disable it.
# You should execute `blt blt:init:git-hooks` after modifying these values.
hooks:
pre-commit: ${blt.root}/scripts/git-hooks
commit-msg: ${blt.root}/scripts/git-hooks
Expand Down
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://raw.githubusercontent.com/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
2 changes: 1 addition & 1 deletion docs/code-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ It is not possible to create an exhaustive list of all things that should be che
* Use of global $language, LANGUAGE_NONE instead of 'und'
* Use of t()
* Does it follow basic code principles?
* Functions are logically amotic with low cyclomatic complexity
* Functions are logically atomic with low cyclomatic complexity
* Logic is being performed at the correct layer, e.g., no logic in the presentation layer.
* Are its components re-usable?
* Verify best practices are being used:
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
2 changes: 1 addition & 1 deletion docs/extending-blt.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ You may use a custom git hook in place of BLT's default git hooks by setting its

In this example, an executable file named `pre-commit` should exist in `${repo.root}/my-custom-git-hooks`.

You should execute `blt blt:init:git-hooks` after modifying these values in order for changes to take effect.
You should execute `blt blt:init:git-hooks` after modifying these values in order for changes to take effect. Also note that most projects will already have a `git` key in their `blt.yml` file, make sure to append `hooks` to this existing key.

#### commit-msg

Expand Down
8 changes: 4 additions & 4 deletions docs/local-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ No matter what local environment you choose to use, the following guidelines sho
* In order to guarantee similar behavior, use Apache as your web server
* If your project is hosted on Acquia Cloud, please ensure to match [our software versions](https://docs.acquia.com/cloud/arch/tech-platform)

Acquia developers use [PHPStorm](http://www.jetbrains.com/phpstorm/) and recommend it for local development environments. Acquia has written [several articles](https://docs.acquia.com/site-search?search=phpstorm) on effectively using PHPStorm for Drupal development.
Acquia developers use [PHPStorm](http://www.jetbrains.com/phpstorm/) and recommend it for local development environments. Acquia has written [several articles](https://docs.acquia.com/#stq=phpstorm&stp=1) on effectively using PHPStorm for Drupal development.

## Using Drupal VM for BLT-generated projects

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
13 changes: 13 additions & 0 deletions docs/memcache.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ Before enabling the Memcache module, it is important to understand how the Drupa

BLT modifies the Memcache module integration on Acquia Cloud. BLT's configuration explicitly overrides the default bins for the discovery, bootstrap, and config cache bins because Drupal core permanently caches these static bins by default. This is required for rebuilding service definitions accurately on cache rebuilds and deploys. See [caching.settings.php](/settings/cache.settings.php).

## Acquia Cloud Site Factory

As of BLT 9.2, the factory hooks contain the necessary code to handle memcache integration with ACSF provided that your subscription and hardware are properly configured. [Using Memcached on Acquia Cloud](https://docs.acquia.com/acquia-cloud/performance/memcached/) provides additional information about this.

If you are upgrading from a previous version of BLT to 9.2.x, make sure and re-generate your factory hooks using:

```
recipes:acsf:init:hooks
```

This will create a new memcache factory hook for use on ACSF.


## Local Development

The below has been tested with DrupalVM as configured through BLT's `blt vm` command, but should also work for most CI environments where the memcache backend is localhost on port 11211.
Expand Down
4 changes: 2 additions & 2 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<!-- Set ignore extensions. -->
<!-- @see https://www.drupal.org/node/2867601#comment-12075633 -->
<arg name="ignore" value="*.css,*.md,*.txt"/>
<arg name="ignore" value="*.css,*.md,*.txt,*.yml"/>

<!-- Use colors in output. -->
<arg name="colors"/>
Expand All @@ -26,8 +26,8 @@
<file>bin/blt</file>
<file>RoboFile.php</file>
<file>scripts/blt/examples</file>
<file>scripts/factory-hooks</file>
<file>src/Robo</file>
<file>settings</file>
<file>tests</file>
<file>template/blt</file>

Expand Down
29 changes: 29 additions & 0 deletions scripts/blt/drush/cache.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

/**
* @file
* Creates a unique temporary cache directory given a site, env, and uri.
* This is used for every blt command invocation on site install and update.
*/

$site = $argv[1];
$env = $argv[2];
$uri = $argv[3];


if (empty($argv[3])) {
echo "Error: Not enough arguments. Site, environment, and uri are required.\n";
exit(1);
}

// Create a temporary cache directory for this drush process only.
$cache_directory = sprintf('/mnt/tmp/%s.%s/drush_tmp_cache/%s', $site, $env, md5($uri));
shell_exec(sprintf('mkdir -p %s', escapeshellarg($cache_directory)));

if (!file_exists($cache_directory)) {
syslog(LOG_ERR, sprintf('Drush updates could not be executed, as the required cache directory [%s] is missing.', $cache_directory));
die('Missing or corrupted drush cache for this process.');
}
else {
echo "$cache_directory";
}
24 changes: 15 additions & 9 deletions scripts/factory-hooks/db-update/db-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,27 @@ db_role="$3"
domain="$4"

# BLT executable:
blt="/var/www/html/$site.$env/vendor/acquia/blt/bin/blt"
blt="/mnt/www/html/$site.$env/vendor/acquia/blt/bin/blt"

# You need the URI of the site factory website in order for drush to target that
# site. Without it, the drush command will fail. Use the uri.php file provided by the acsf module to
# locate the URI based on the site, environment and db role arguments.
uri=`/usr/bin/env php /mnt/www/html/$site.$env/hooks/acquia/uri.php $site $env $db_role`

# Print a statement to the cloud log.
echo "$site.$target_env: Running BLT deploy tasks on $uri domain in $env environment on the $site subscription."

# Create array with site name fragments from ACSF uri.
IFS='.' read -a name <<< "${uri}"

# Set Drush cache to local ephemeral storage to avoid race conditions. This is
# done on a per site basis to completely avoid race conditions.
# @see https://github.com/acquia/blt/pull/2922
export DRUSH_PATHS_CACHE_DIRECTORY=/tmp/.drush/${db_role}
# Create and set Drush cache to unique local temporary storage per site.
# This approach isolates drush processes to completely avoid race conditions
# that persist after initial attempts at addressing in BLT: https://github.com/acquia/blt/pull/2922

cacheDir=`/usr/bin/env php /mnt/www/html/$site.$env/vendor/acquia/blt/scripts/blt/drush/cache.php $site $env $uri`

# Print to cloud task log.
echo "Generated temporary drush cache directory: $cacheDir."

# Print to cloud task log.
echo "Running BLT deploy tasks on $uri domain in $env environment on the $site subscription."

DRUSH_PATHS_CACHE_DIRECTORY=$cacheDir $blt drupal:update --environment=$env --site=${name[0]} --define drush.uri=$domain --verbose --yes --no-interaction

$blt drupal:update --environment=$env --site=${name[0]} --define drush.uri=$domain --verbose --yes
Loading

0 comments on commit eaa3940

Please sign in to comment.