Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Fixes #985: Implement deploy_install() to rebuild projects on deploy. #986

Merged
merged 1 commit into from
Feb 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions phing/tasks/deploy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,31 @@
<!-- Tag build repo with [tag]. -->
<exec dir="${deploy.dir}" command="git tag -a ${deploy.tag} -m '${deploy.commitMsg}'" logoutput="true" level="${blt.exec_level}" passthru="true"/>
</target>

<target name="deploy:drupal:install"
description="Installs a specific Drupal site."
depends="setup:hash-salt">

<if>
<istrue value="${drush.verbose}"/>
<then>
<echo>Printing drush status</echo>
<drush command="status"/>
</then>
</if>

<echo>Installing Drupal.</echo>
<drush command="site-install">
<option name="site-name">"${project.human_name}"</option>
<option name="site-mail">"${drupal.account.mail}"</option>
<option name="account-name">"${drupal.account.name}"</option>
<option name="account-pass">"${drupal.account.password}"</option>
<option name="account-mail">"${drupal.account.mail}"</option>
<param>"${project.profile.name}"</param>
<param>"install_configure_form.update_status_module='array(FALSE,FALSE)'"</param>
</drush>

<phingcall target="deploy:update"/>

</target>
</project>
19 changes: 17 additions & 2 deletions scripts/cloud-hooks/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,20 @@ deploy_updates() {
echo "Finished updates for environment: $target_env"
}

# TODO: Add a deploy_install command for projects early in development that want
# to reinstall on every deploy.
deploy_install() {

echo "Installing site for environment: $target_env"

# Prep for BLT commands.
repo_root="/var/www/html/$site.$target_env"
export PATH=$repo_root/vendor/bin:$PATH
cd $repo_root

blt deploy:drupal:install -Denvironment=$target_env
if [ $? -ne 0 ]; then
echo "Install errored."
status=1;
fi

echo "Finished installing for environment: $target_env"
}