Skip to content

Commit

Permalink
Update db-update.sh (#3293)
Browse files Browse the repository at this point in the history
* Update db-update.sh

Allow ACSF subpath domains to work with drush commands in db-update factory hook.

* Update db-update.sh
  • Loading branch information
grasmash authored and mikemadison13 committed Dec 15, 2018
1 parent eaa3940 commit 3ca228b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/factory-hooks/db-update/db-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ blt="/mnt/www/html/$site.$env/vendor/acquia/blt/bin/blt"
# 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`

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

# Create and set Drush cache to unique local temporary storage per site.
Expand All @@ -40,5 +40,11 @@ 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
# Replace all "/" characters with ".", because as of Drush 9.5, Drush will
# truncate the string at "/". This Drush behavior prevents ACSF sites from defining
# domains with site path suffixes. E.g., "www.example.com/site-path" which
# would be translated a sites.php entry with the key "www.example.com.site-path"
# in a browser-based request, cannot be used via drush without first replacing the "/".
drush_uri=$(echo ${domain} | sed -r 's/[/]+/./g')

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

0 comments on commit 3ca228b

Please sign in to comment.