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

Increasing verbosity of all exec tasks. #347

Merged
merged 2 commits into from
Sep 1, 2016
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
2 changes: 1 addition & 1 deletion phing/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<then>
<echo>Executing command in ${target-hooks.${hook-name}.dir}:</echo>
<echo>${target-hooks.${hook-name}.command}</echo>
<exec dir="${target-hooks.${hook-name}.dir}" command="${target-hooks.${hook-name}.command}" logoutput="true" checkreturn="true" passthru="true" />
<exec dir="${target-hooks.${hook-name}.dir}" command="${target-hooks.${hook-name}.command}" logoutput="true" checkreturn="true" level="info" passthru="true" />
</then>
<else>
<fail>The directory ${target-hooks.${hook-name}.dir} does not exist. Will not run command for ${hook-name}.</fail>
Expand Down
2 changes: 1 addition & 1 deletion phing/tasks/acsf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</then>
</if>

<exec dir="${docroot}" command="${drush.cmd} --include=${docroot}/modules/contrib/acsf/acsf_init acsf-init --skip-default-settings -y" logoutput="true" checkreturn="true"/>
<exec dir="${docroot}" command="${drush.cmd} --include=${docroot}/modules/contrib/acsf/acsf_init acsf-init --skip-default-settings -y" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<echo>Please add acsf_init as a dependency for your installation profile to ensure that it remains enabled.</echo>
<echo>An example alias file for ACSF is located in /drush/site-aliases/example.acsf.aliases.drushrc.php.</echo>
</target>
Expand Down
28 changes: 14 additions & 14 deletions phing/tasks/blt.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<project name="blt" default="update">
<target name="create-project" depends="init">
<exec dir="${repo.root}" command="git init" logoutput="true" checkreturn="true" passthru="true"/>
<exec dir="${repo.root}" command="git init" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<echo>Updating composer dependencies, this make take a while...</echo>
<exec dir="${repo.root}" command="export COMPOSER_PROCESS_TIMEOUT=600; composer update" logoutput="true" checkreturn="true" passthru="true"/>
<exec dir="${repo.root}" command="git add -A" logoutput="true" checkreturn="true" passthru="true"/>
<exec dir="${repo.root}" command="git commit -m 'Initial commit.'" logoutput="true" checkreturn="true" passthru="true"/>
<exec dir="${repo.root}" command="rm LICENSE.txt" logoutput="true" checkreturn="true"/>
<exec dir="${repo.root}" command="export COMPOSER_PROCESS_TIMEOUT=600; composer update" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<exec dir="${repo.root}" command="git add -A" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<exec dir="${repo.root}" command="git commit -m 'Initial commit.'" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<exec dir="${repo.root}" command="rm LICENSE.txt" logoutput="true" checkreturn="true" level="info" passthru="true"/>
</target>

<target name="init" depends="blt:rsync-template, blt:update-composer, blt:update-yml, setup:drupal:settings">
Expand All @@ -21,16 +21,16 @@
<target name="blt:rsync-template">
<echo>Copying files from BLT's template into your project.</echo>
<!-- @todo Do not overwrite structured or executable files. Instead, update them intelligently settings.php, drush.wrapper etc. -->
<exec dir="${repo.root}" command="rsync -a --no-g ${blt.root}/template/ ${repo.root}/ --exclude '/project.yml' --exclude '/composer.json' --exclude '/README.md'" logoutput="true" checkreturn="true"/>
<exec dir="${repo.root}" command="rsync -a --no-g ${blt.root}/template/ ${repo.root}/ --exclude '/project.yml' --exclude '/composer.json' --exclude '/README.md'" logoutput="true" checkreturn="true" level="info" passthru="true"/>

<!--Rsync files without overwriting existing-->
<exec dir="${repo.root}" command="rsync -a --no-g ${blt.root}/template/project.yml ${repo.root}/ --ignore-existing" logoutput="true" checkreturn="true"/>
<exec dir="${repo.root}" command="rsync -a --no-g ${blt.root}/template/README.md ${repo.root}/ --ignore-existing" logoutput="true" checkreturn="true"/>
<exec dir="${repo.root}" command="rsync -a --no-g ${blt.root}/template/project.yml ${repo.root}/ --ignore-existing" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<exec dir="${repo.root}" command="rsync -a --no-g ${blt.root}/template/README.md ${repo.root}/ --ignore-existing" logoutput="true" checkreturn="true" level="info" passthru="true"/>
</target>

<target name="update" depends="init, blt:update-yml, configure">
<!-- @todo Ignore some files, settings.php, project.yml, in update. Instead, change only specific values. -->
<exec dir="${repo.root}" command="${blt.root}/scripts/blt/update.sh" logoutput="true" checkreturn="true" />
<exec dir="${repo.root}" command="${blt.root}/scripts/blt/update.sh" logoutput="true" checkreturn="true" level="info" passthru="true" />
<echo>Some of your customized files may have been modified.</echo>
<echo>Please review changes with "git diff".</echo>
<echo>If your composer.json was modified, you need to run "composer update".</echo>
Expand All @@ -42,9 +42,9 @@
<echo>Merging BLT's composer.json template with your project's composer.json.</echo>
<echo>This MAY overwrite some existing values.</echo>
<!--Values in the project's existing composer.json file will be overwritten.-->
<exec dir="${repo.root}" command="${repo.root}/vendor/bin/blt-console composer:munge ${repo.root}/composer.json ${blt.root}/template/composer.json > ${repo.root}/composer.json.tmp" logoutput="true" checkreturn="true"/>
<exec dir="${repo.root}" command="${repo.root}/vendor/bin/blt-console composer:munge ${repo.root}/composer.json ${blt.root}/template/composer.json > ${repo.root}/composer.json.tmp" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<!--@todo Find out why can't we just redirect output directly back to composer.json. -->
<exec dir="${repo.root}" command="mv ${repo.root}/composer.json.tmp ${repo.root}/composer.json" logoutput="true" checkreturn="true"/>
<exec dir="${repo.root}" command="mv ${repo.root}/composer.json.tmp ${repo.root}/composer.json" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<echo>If your composer.json was modified, you need to run "composer update".</echo>
</target>

Expand All @@ -53,9 +53,9 @@
<echo>Merging BLT's project.yml template with your project's project.yml</echo>
<echo>This WILL NOT overwrite existing values.</echo>
<!--Values in the project's existing project.yml file will be preserved and not overridden.-->
<exec dir="${repo.root}" command="${repo.root}/vendor/bin/blt-console yaml:munge ${blt.root}/template/project.yml ${repo.root}/project.yml > ${repo.root}/project.yml.tmp" logoutput="true" checkreturn="true"/>
<exec dir="${repo.root}" command="${repo.root}/vendor/bin/blt-console yaml:munge ${blt.root}/template/project.yml ${repo.root}/project.yml > ${repo.root}/project.yml.tmp" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<!--@todo Find out why can't we just redirect output directly back to project.yml. -->
<exec dir="${repo.root}" command="mv ${repo.root}/project.yml.tmp ${repo.root}/project.yml" logoutput="true" checkreturn="true"/>
<exec dir="${repo.root}" command="mv ${repo.root}/project.yml.tmp ${repo.root}/project.yml" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<echo>project.yml has been modified.</echo>
</target>

Expand Down Expand Up @@ -88,7 +88,7 @@
<not><equals arg1="${create_alias}" arg2="false"/></not>
<then>
<!-- @todo Add this to ~/.blt/aliases and include that into ~/.bashrc or whatever. -->
<exec dir="${blt.root}/scripts/blt" command="./install-alias.sh" logoutput="true" passthru="true"/>
<exec dir="${blt.root}/scripts/blt" command="./install-alias.sh" logoutput="true" level="info" passthru="true"/>
</then>
</if>
</target>
Expand Down
30 changes: 15 additions & 15 deletions phing/tasks/deploy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@
<echo message="Fetching from git remote ${deploy.remote}"/>

<!-- Generate an md5 sum of the remote URL to use as remote name. -->
<exec command="echo ${deploy.remote} | openssl md5 | cut -d' ' -f 2" outputProperty="remoteName" checkreturn="true"/>
<exec command="git remote add ${remoteName} ${deploy.remote}" dir="${deploy.dir}" logoutput="true" passthru="true" checkreturn="true"/>
<exec command="echo ${deploy.remote} | openssl md5 | cut -d' ' -f 2" outputProperty="remoteName" checkreturn="true" level="info"/>
<exec command="git remote add ${remoteName} ${deploy.remote}" dir="${deploy.dir}" logoutput="true" checkreturn="true" level="info" passthru="true"/>

<!-- @todo Only call this for the first remote. -->
<phingcall target="deploy:remote:pull" />
</target>

<target name="deploy:remote:pull" description="Checks out deploy branch from upstream remote.">
<exec command="git fetch ${remoteName} ${deploy.branch}" dir="${deploy.dir}" logoutput="true" passthru="true"/>
<exec command="git fetch ${remoteName} ${deploy.branch}" dir="${deploy.dir}" logoutput="true" level="info" passthru="true"/>

<!-- Create the new branch, "[source-branch-name]-build". -->
<exec command="git checkout -b ${deploy.branch}" dir="${deploy.dir}" logoutput="true" passthru="true" checkreturn="true"/>
<exec command="git checkout -b ${deploy.branch}" dir="${deploy.dir}" logoutput="true" checkreturn="true" level="info" passthru="true"/>

<!-- Pull the latest updates (if available). -->
<exec command="git merge ${remoteName}/${deploy.branch}" dir="${deploy.dir}" logoutput="true" passthru="true"/>
Expand All @@ -82,8 +82,8 @@

<target name="deploy:commit">
<!-- We make these commands quiet because they can cause the output to be so long that Travis CI stops logging. -->
<exec command="git add -A" dir="${deploy.dir}" logoutput="true" passthru="true" checkreturn="true"/>
<exec command="git commit -m '${deploy.commitMsg}' --quiet" dir="${deploy.dir}" logoutput="true" passthru="true" checkreturn="true"/>
<exec command="git add -A" dir="${deploy.dir}" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<exec command="git commit -m '${deploy.commitMsg}' --quiet" dir="${deploy.dir}" logoutput="true" checkreturn="true" level="info" passthru="true"/>
</target>

<target name="deploy:composer:install" description="Downloads core and contrib to deploy folder.">
Expand All @@ -98,7 +98,7 @@
<include name="composer.lock"/>
</fileset>
</copy>
<exec dir="${deploy.dir}" command="export COMPOSER_EXIT_ON_PATCH_FAILURE=1; composer install --no-dev --prefer-dist --no-interaction" passthru="true" logoutput="true" checkreturn="true"/>
<exec dir="${deploy.dir}" command="export COMPOSER_EXIT_ON_PATCH_FAILURE=1; composer install --no-dev --prefer-dist --no-interaction" logoutput="true" checkreturn="true" level="info" passthru="true"/>
</then>
<else>
<echo>Dependencies will not be built because deploy.build-dependencies is not enabled.</echo>
Expand All @@ -113,7 +113,7 @@
<!-- @todo Support multisite. -->
<chmod file="${docroot}/sites/default" mode="0777" />

<exec dir="${repo.root}" command="rsync -a --no-g --delete --delete-excluded --exclude-from=${deploy.exclude_file} ${repo.root}/ ${deploy.dir}/ --filter 'protect /.git/'" logoutput="true" checkreturn="true"/>
<exec dir="${repo.root}" command="rsync -a --no-g --delete --delete-excluded --exclude-from=${deploy.exclude_file} ${repo.root}/ ${deploy.dir}/ --filter 'protect /.git/'" logoutput="true" checkreturn="true" level="info" passthru="true"/>

<!-- Use our own .gitignore -->
<copy file="${deploy.gitignore_file}" tofile="${deploy.dir}/.gitignore" overwrite="true"/>
Expand All @@ -125,8 +125,8 @@

<target name="deploy:prepare-dir" description="Delete the existing deploy directory and re-initialize as an empty git repository.">
<delete dir="${deploy.dir}" failonerror="false" quiet="true" />
<exec command="git init ${deploy.dir}" logoutput="true" checkreturn="true"/>
<exec dir="${deploy.dir}" command="git config --local core.excludesfile false" logoutput="true" checkreturn="true"/>
<exec command="git init ${deploy.dir}" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<exec dir="${deploy.dir}" command="git config --local core.excludesfile false" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<echo>Global .gitignore file is being disabled for this repository to prevent unexpected behavior.</echo>
</target>

Expand All @@ -136,13 +136,13 @@

<target name="deploy:push-remote" description="Pushes to a git remote.">
<exec command="echo ${deploy.remote} | openssl md5 | cut -d' ' -f 2" outputProperty="remoteName"/>
<exec command="git push ${remoteName} ${deploy.branch}" dir="${deploy.dir}" logoutput="true" outputProperty="deploy.push.output" checkreturn="true"/>
<exec command="export DEPLOY_UPTODATE=$(echo '${deploy.push.output}' | grep --quiet 'Everything up-to-date')"/>
<exec command="git push ${remoteName} ${deploy.branch}" dir="${deploy.dir}" outputProperty="deploy.push.output" logoutput="true" checkreturn="true" level="info"/>
<exec command="export DEPLOY_UPTODATE=$(echo '${deploy.push.output}' | grep --quiet 'Everything up-to-date')" logoutput="true" checkreturn="true" level="info" passthru="true"/>
</target>

<target name="deploy:sanitize" description="Removes sensitive files from the deploy docroot.">
<exec command="find . -type d | grep '\.git' | xargs rm -rf" dir="${deploy.dir}/docroot"/>
<exec command="find . -type d | grep '\.git' | xargs rm -rf" dir="${deploy.dir}/vendor"/>
<exec command="find . -type d | grep '\.git' | xargs rm -rf" dir="${deploy.dir}/docroot" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<exec command="find . -type d | grep '\.git' | xargs rm -rf" dir="${deploy.dir}/vendor" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<delete>
<fileset dir="${deploy.dir}/docroot">
<include name="core/*.txt"/>
Expand All @@ -153,6 +153,6 @@

<target name="deploy:acsf:init" description="Re-initialize ACSF with the settings.php changes required for artifact.">
<chmod file="${deploy.dir}/docroot/sites/default/settings.php" mode="0755" />
<exec dir="${deploy.dir}/docroot" command="${drush.bin} --include=${deploy.dir}/docroot/modules/contrib/acsf/acsf_init acsf-init -r ${deploy.dir}/docroot -y" logoutput="true" checkreturn="true"/>
<exec dir="${deploy.dir}/docroot" command="${drush.bin} --include=${deploy.dir}/docroot/modules/contrib/acsf/acsf_init acsf-init -r ${deploy.dir}/docroot -y" logoutput="true" checkreturn="true" level="info" passthru="true"/>
</target>
</project>
8 changes: 4 additions & 4 deletions phing/tasks/local-sync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

<target name="local:sync" description="Synchronize local environment from remote (remote --> local)."
depends="setup:drupal:settings">
<exec dir="${docroot}" command="${drush.cmd} sql-drop -y" logoutput="true" checkreturn="true"/>
<exec dir="${docroot}" command="${drush.cmd} sql-drop -y" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<!--We cannot use drush.cmd here because it incorrectly assigns an alias to the command. -->
<exec dir="${docroot}" command="${drush.bin} -r ${docroot} -l ${multisite.name} sql-sync @${drush.aliases.remote} @${drush.aliases.local} --create-db --structure-tables-key=lightweight -y" logoutput="true" checkreturn="true"/>
<exec dir="${docroot}" command="${drush.cmd} cc drush" logoutput="true" checkreturn="true"/>
<exec dir="${docroot}" command="${drush.cmd} cr" logoutput="true" checkreturn="true"/>
<exec dir="${docroot}" command="${drush.bin} -r ${docroot} -l ${multisite.name} sql-sync @${drush.aliases.remote} @${drush.aliases.local} --create-db --structure-tables-key=lightweight -y" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<exec dir="${docroot}" command="${drush.cmd} cc drush" logoutput="true" checkreturn="true" level="info" passthru="true"/>
<exec dir="${docroot}" command="${drush.cmd} cr" logoutput="true" checkreturn="true" level="info" passthru="true"/>
</target>

<target name="local:update" description="Update current database to reflect the state of the Drupal file system; uses local drush alias.">
Expand Down
12 changes: 6 additions & 6 deletions phing/tasks/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
<include name="vendor"/>
</fileset>
</delete>
<exec dir="${repo.root}" command="composer clear-cache" logoutput="true" passthru="true" checkreturn="true"/>
<exec dir="${repo.root}" command="composer clear-cache" logoutput="true" checkreturn="true" level="info" passthru="true"/>
</target>

<target name="setup:composer:install" description="Installs project dependencies, including drupal core and contrib.">
<exec dir="${repo.root}" command="export COMPOSER_EXIT_ON_PATCH_FAILURE=1; composer install --ansi --no-interaction" logoutput="true" passthru="true" checkreturn="true"/>
<exec dir="${repo.root}" command="export COMPOSER_EXIT_ON_PATCH_FAILURE=1; composer install --ansi --no-interaction" logoutput="true" checkreturn="true" level="info" passthru="true" />
</target>

<target name="setup:drupal:settings" description="Create local settings files using default settings files.">
Expand All @@ -61,7 +61,7 @@
<echo>Making ${docroot}/sites/default/settings.php writable.</echo>
<chmod mode="0755" failonerror="false" file="${docroot}/sites/default/settings.php"/>
<echo>Ensuring that blt.settings.php is required by settings.php</echo>
<exec dir="${docroot}/sites/default" command="grep blt.settings.php settings.php || echo 'require DRUPAL_ROOT . &quot;/sites/default/settings/blt.settings.php&quot;;' >> settings.php " logoutput="false" checkreturn="true"/>
<exec dir="${docroot}/sites/default" command="grep blt.settings.php settings.php || echo 'require DRUPAL_ROOT . &quot;/sites/default/settings/blt.settings.php&quot;;' >> settings.php " logoutput="true" checkreturn="true" level="info" passthru="true"/>

<echo>Generating local settings files.</echo>

Expand Down Expand Up @@ -147,7 +147,7 @@
</drush>

<!-- Make db site uuid match site uuid of exported config. -->
<!--<exec dir="${repo.root}" command="cat ./config/default/system.site.yml | grep uuid | tail -c +7 | head -c 36 | ${drush.cmd} config-set -y system.site uuid -" logoutput="true" checkreturn="true"/>-->
<!--<exec dir="${repo.root}" command="cat ./config/default/system.site.yml | grep uuid | tail -c +7 | head -c 36 | ${drush.cmd} config-set -y system.site uuid -" logoutput="true" checkreturn="true" level="info"/>-->

<drush command="config-import" assume="yes" alias="${drush.alias}">
<option name="partial"></option>
Expand All @@ -161,7 +161,7 @@
<delete dir="${repo.root}/.git/hooks" quiet="true" failonerror="false"/>
<delete file="${repo.root}/.git/hooks" quiet="true" failonerror="false"/>
<echo>Symlinking ${repo.root}/scripts/git-hooks to ${repo.root}/.git/hooks.</echo>
<exec dir="${repo.root}/.git" command="ln -snv ../vendor/acquia/blt/scripts/git-hooks hooks" logoutput="true"/>
<exec dir="${repo.root}/.git" command="ln -snv ../vendor/acquia/blt/scripts/git-hooks hooks" logoutput="true" checkreturn="true" level="info" passthru="true"/>

<!-- Grant execution permissions. -->
<echo>Making git hooks executable.</echo>
Expand All @@ -182,7 +182,7 @@
<echo>Writing hash salt to ${repo.root}/salt.txt</echo>
<taskdef name="randomString" classname="${repo.root}.vendor.platinumpixs.phing-random-string.src.PlatinumPixs.RandomString.GenerateTask" />
<randomString name="project.hash_salt" length="55" stringType="lowercase_uppercase_numeric" />
<exec dir="${repo.root}" command="echo ${project.hash_salt} > salt.txt" logoutput="true" checkreturn="true"/>
<exec dir="${repo.root}" command="echo ${project.hash_salt} > salt.txt" logoutput="true" checkreturn="true" level="info" passthru="true"/>
</then>
<else>
<echo>${repo.root}/salt.txt already exists.</echo>
Expand Down
Loading