Skip to content

Commit

Permalink
Acsf hooks deploy (#2227)
Browse files Browse the repository at this point in the history
* Add db update factory hook to run blt updates on deploy.

* Disable post-code-deploy hooks on acsf projects, disable post-code-update hook on 01live environments by default.

* Fix typo in Cloud Hook functions.

* Fixed typos and variable names.

* Fix path for BLT cloud hooks script.
  • Loading branch information
lcatlett authored and grasmash committed Dec 12, 2017
1 parent 4853eb0 commit e339a75
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/cloud-hooks/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ drush_alias=${site}'.'${target_env}
deploy_updates() {

case $target_env in
01dev|01test|01live)
01dev|01test)
acsf_deploy
;;
01devup|01testup|01update)
# Do not run deploy updates on 01live in case a branch is deployed in prod.
01devup|01testup|01update|01live)
;;
ode[[:digit:]]*)
deploy_install
Expand Down Expand Up @@ -108,4 +109,4 @@ deploy_install() {
fi

echo "Finished installing for environment: $target_env"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ repo_url="$5"
repo_type="$6"


acsf_file="/mnt/files/$site.$target_env/files-private/sites.json"
if [ ! -f $acsf_file ]; then
. /var/www/html/$site.$target_env/vendor/acquia/blt/scripts/cloud-hooks/functions.sh
deploy_updates
fi
# Send notifications to Slack, if configured. See readme/deploy.md for setup instructions.
. `dirname $0`/../slack.sh


set +v
25 changes: 25 additions & 0 deletions settings/acsf/db-update/db-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh
#
# Factory Hook: db-update
#
# The existence of one or more executable files in the
# /factory-hooks/db-update directory will prompt them to be run *instead of* the
# regular database update (drush updatedb) command. So that update command will
# normally be part of the commands executed below.
#
# Usage: post-code-deploy site env db-role domain custom-arg
# Map the script inputs to convenient names.
# Acquia hosting site / environment names
site="$1"
env="$2"
# database role. (Not expected to be needed in most hook scripts.)
db_role="$3"
# The public domain name of the website.
domain="$4"

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

deployupdate="$blt deploy:update --define environment=$env --define drush.uri=$domain -v -y"

$deployupdate

0 comments on commit e339a75

Please sign in to comment.