Skip to content

Commit

Permalink
Fixing deploy:update target. (#1281)
Browse files Browse the repository at this point in the history
  • Loading branch information
grasmash authored Mar 31, 2017
1 parent 4157d9a commit 551da5e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions phing/tasks/deploy.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<project name="deploy" default="deploy">

<target name="deploy" description="Builds separate artifact and pushes to git.remotes defined project.yml.">

<!-- Check working tree, fail if there are uncommitted changes in the project root. -->
<exec dir="${repo.root}" command="status=$(git status --porcelain); echo ${#status};"
outputProperty="git.status.length" checkreturn="true"/>
Expand All @@ -11,7 +11,7 @@
<fail>There are uncommitted changes, commit or stash these changes before deploying.</fail>
</then>
</if>

<!-- Build some defaults -->
<exec command="git rev-parse --abbrev-ref HEAD" dir="${repo.root}" outputProperty="branch.current"/>
<exec command="git log --oneline -1" dir="${repo.root}" outputProperty="deploy.commitMsg.last"/>
Expand Down Expand Up @@ -153,9 +153,9 @@

<if>
<equals arg1="${simplesamlphp}" arg2="true"/>
<then>
<phingcall target="simplesamlphp:deploy:config"/>
</then>
<then>
<phingcall target="simplesamlphp:deploy:config"/>
</then>
</if>
</target>

Expand Down Expand Up @@ -275,7 +275,7 @@
<property name="drush.uri" value="${deploy.site.name}"/>
<!-- Most sites store their version-controlled configuration in /config/default. -->
<!-- ACE internally sets the vcs configuration directory to /config/default, so we use that. -->
<property name="cm.core.config-dir.key" value="${cm.core.config-dir.deploy-key}"/>
<property name="cm.core.key" value="${cm.core.deploy-key}"/>
</phingcall>
<echo>Finished deploying updates to ${deploy.site.name}</echo>
</target>
Expand Down
17 changes: 9 additions & 8 deletions phing/tasks/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

<if>
<equals arg1="${simplesamlphp}" arg2="true"/>
<then>
<phingcall target="simplesamlphp:build:config"/>
</then>
<then>
<phingcall target="simplesamlphp:build:config"/>
</then>
</if>

<phingcall target="target-hook:invoke">
Expand Down Expand Up @@ -243,7 +243,9 @@
<target name="setup:config-import:config-split">

<if>
<available file="${cm.core.dirs.${cm.core.key}.path}/core.extension.yml"/>
<!-- We cannot use ${cm.core.dirs.${cm.core.key}.path} here because cm.core.key may be 'vcs', which does not have a path defined in BLT config. Perhaps this
should be refactored. -->
<available file="${cm.core.dirs.sync.path}/core.extension.yml"/>
<then>

<drush command="en" assume="yes" alias="${drush.alias}" passthru="false">
Expand All @@ -254,7 +256,6 @@
<if>
<and>
<isset property="env.AH_SITE_ENVIRONMENT"/>
<available file="${cm.core.path}/${env.AH_SITE_ENVIRONMENT}"/>
</and>
<then>
<drush command="config-import" assume="yes" alias="${drush.alias}">
Expand Down Expand Up @@ -335,9 +336,9 @@
</target>

<target name="setup:cloud-hooks" description="Installs Acquia cloud hooks to hooks directory from version controlled scripts/cloud-hooks directory.">
<copy todir="${repo.root}/hooks" >
<fileset dir="${blt.root}/scripts/cloud-hooks/hooks"/>
</copy>
<copy todir="${repo.root}/hooks" >
<fileset dir="${blt.root}/scripts/cloud-hooks/hooks"/>
</copy>
</target>

<target name="setup:hash-salt" description="Generates and writes a hash salt to ${repo.root}/salt.txt if one does not exist.">
Expand Down
15 changes: 7 additions & 8 deletions scripts/cloud-hooks/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ deploy_updates() {
esac
}


acsf_deploy() {
sites=()
# Prep for BLT commands.
Expand All @@ -27,16 +26,16 @@ acsf_deploy() {

echo "Running updates for environment: $target_env"

# Generate an array of all site URIs on the Factory from parsed output of Drush utility.
while IFS=$'\n' read -r line; do
# Generate an array of all site URIs on the Factory from parsed output of Drush utility.
while IFS=$'\n' read -r line; do
sites[i++]="$line"
done < <(drush @"${drush_alias}" --include=./drush acsf-tools-list | grep domains: -A 1 | grep 0: | sed -e 's/^[0: ]*//')
unset IFS

# Loop through each available site uri and run BLT deploy updates.
for uri in "${sites[@]}"; do
#Override BLT default deploy uri.
blt deploy:update -Denvironment=$target_env -Ddrush.uri="$uri"
#Override BLT default deploy uri.
blt deploy:update -Denvironment=$target_env -Ddrush.uri="$uri" -Dblt.verbose=true
if [ $? -ne 0 ]; then
echo "Update errored."
status=1;
Expand All @@ -57,15 +56,15 @@ ace_deploy() {
export PATH=$repo_root/vendor/bin:$PATH
cd $repo_root

blt deploy:update -Denvironment=$target_env
blt deploy:update -Denvironment=$target_env -Dblt.verbose=true
if [ $? -ne 0 ]; then
echo "Update errored."
status=1;
fi

echo "Finished updates for environment: $target_env"
}

deploy_install() {

echo "Installing site for environment: $target_env"
Expand All @@ -75,7 +74,7 @@ deploy_install() {
export PATH=$repo_root/vendor/bin:$PATH
cd $repo_root

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

0 comments on commit 551da5e

Please sign in to comment.