Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing deploy:update target. #1281

Merged
merged 1 commit into from
Mar 31, 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
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 @@ -274,7 +274,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>
</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