Skip to content

Commit

Permalink
Hiding subtargets from blt command list. (#449)
Browse files Browse the repository at this point in the history
* Hiding BLT targets.

* Hiding validate targets.

* Hiding more targets.
  • Loading branch information
grasmash authored Sep 26, 2016
1 parent 5894a6e commit 749c944
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
12 changes: 6 additions & 6 deletions phing/tasks/blt.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<project name="blt" default="update">
<target name="create-project">
<target name="create-project" hidden="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 --no-interaction" logoutput="true" checkreturn="true" level="info" passthru="true"/>
Expand All @@ -14,7 +14,7 @@
</drush>
</target>

<target name="blt:rsync-template">
<target name="blt:rsync-template" hidden="true">
<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-from=${blt.update.ignore-existing-file}" logoutput="true" checkreturn="true" level="info" passthru="true"/>
Expand All @@ -23,7 +23,7 @@
<exec dir="${repo.root}" command="rsync -a --no-g ${blt.root}/template/ ${repo.root}/ --include-from=${blt.update.ignore-existing-file} --ignore-existing" logoutput="true" checkreturn="true" level="info" passthru="true"/>
</target>

<target name="update" depends="blt:rsync-template, blt:update-composer, blt:update-yml, setup:drupal:settings">
<target name="update" depends="blt:rsync-template, blt:update-composer, blt:update-yml, setup:drupal:settings" hidden="true">
<phingcall target="install-alias">
<property name="create_alias" value="true"/>
</phingcall>
Expand All @@ -36,7 +36,7 @@
<echo>To remove deprecated BLT files, run "blt cleanup".</echo>
</target>

<target name="blt:update-composer" description="Updates project composer.json with a subset of new key value pairs from upstream. This WILL overwrite existing values.">
<target name="blt:update-composer" description="Updates project composer.json with a subset of new key value pairs from upstream. This WILL overwrite existing values." hidden="true">
<!--@todo Output different message if composer.json does not exist.-->
<echo>Merging BLT's composer.json template with your project's composer.json.</echo>
<echo>This MAY overwrite some existing values.</echo>
Expand All @@ -47,7 +47,7 @@
<echo>If your composer.json was modified, you need to run "composer update".</echo>
</target>

<target name="blt:update-yml" description="Updates project BLT .yml files with new key value pairs from upstream. This WILL NOT overwrite existing values.">
<target name="blt:update-yml" description="Updates project BLT .yml files with new key value pairs from upstream. This WILL NOT overwrite existing values." hidden="true">
<!--@todo Output different message if project.yml does not exist-->
<echo>Merging BLT's project.yml template with your project's project.yml.</echo>
<echo>This WILL NOT overwrite existing values.</echo>
Expand All @@ -62,7 +62,7 @@
<exec dir="${repo.root}" command="${blt.root}/scripts/blt/remove-deprecated.sh" logoutput="true" checkreturn="true" level="info" passthru="true" />
</target>

<target name="install-alias" description="Installs the BLT alias for command line usage.">
<target name="install-alias" description="Installs the BLT alias for command line usage." hidden="true">
<if>
<not><equals arg1="${create_alias}" arg2="false"/></not>
<then>
Expand Down
24 changes: 12 additions & 12 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.">

<!-- Prompt for user input -->
<propertyprompt propertyName="deploy.commitMsg" useExistingValue="true" promptText="Enter a valid commit message" promptCharacter=":" />
<propertyprompt propertyName="deploy.branch" useExistingValue="true" promptText="Enter a deploy branch" promptCharacter=":" />
Expand Down Expand Up @@ -49,7 +49,7 @@
</if>
</target>

<target name="deploy:remote:add" description="Adds a git remote and checks out deploy branch from upstream.">
<target name="deploy:remote:add" description="Adds a git remote and checks out deploy branch from upstream." hidden="true">
<echo message="Fetching from git remote ${deploy.remote}"/>

<!-- Generate an md5 sum of the remote URL to use as remote name. -->
Expand All @@ -60,7 +60,7 @@
<phingcall target="deploy:remote:pull" />
</target>

<target name="deploy:remote:pull" description="Checks out deploy branch from upstream remote.">
<target name="deploy:remote:pull" description="Checks out deploy branch from upstream remote." hidden="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". -->
Expand All @@ -71,7 +71,7 @@
<exec command="git merge ${remoteName}/${deploy.branch}" dir="${deploy.dir}" logoutput="true" passthru="true"/>
</target>

<target name="deploy:add-remotes" description="Add remotes and fetch upstream refs.">
<target name="deploy:add-remotes" description="Add remotes and fetch upstream refs." hidden="true">
<foreach list="${git.remotes}" param="deploy.remote" target="deploy:remote:add"/>
</target>

Expand All @@ -86,13 +86,13 @@
</if>
</target>

<target name="deploy:commit">
<target name="deploy:commit" hidden="true">
<!-- 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" 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.">
<target name="deploy:composer:install" description="Downloads core and contrib to deploy folder." hidden="true">
<if>
<equals arg1="${deploy.build-dependencies}" arg2="true"/>
<then>
Expand All @@ -114,7 +114,7 @@

</target>

<target name="deploy:copy" description="Copy required files from /docroot/sites to /deploy/docroot/sites.">
<target name="deploy:copy" description="Copy required files from /docroot/sites to /deploy/docroot/sites." hidden="true">
<!-- Make sites/default writable so that we can copy files. -->
<!-- @todo Support multisite. -->
<chmod file="${docroot}/sites/default" mode="0777" />
Expand All @@ -129,24 +129,24 @@
<chmod file="${docroot}/sites/default" mode="0755" />
</target>

<target name="deploy:prepare-dir" description="Delete the existing deploy directory and re-initialize as an empty git repository.">
<target name="deploy:prepare-dir" description="Delete the existing deploy directory and re-initialize as an empty git repository." hidden="true">
<delete dir="${deploy.dir}" failonerror="false" quiet="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>

<target name="deploy:push-all">
<target name="deploy:push-all" hidden="true">
<foreach list="${git.remotes}" param="deploy.remote" target="deploy:push-remote"/>
</target>

<target name="deploy:push-remote" description="Pushes to a git remote.">
<target name="deploy:push-remote" description="Pushes to a git remote." hidden="true">
<exec command="echo ${deploy.remote} | openssl md5 | cut -d' ' -f 2" outputProperty="remoteName"/>
<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.">
<target name="deploy:sanitize" description="Removes sensitive files from the deploy docroot." hidden="true">
<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>
Expand All @@ -157,7 +157,7 @@
</delete>
</target>

<target name="deploy:acsf:init" description="Re-initialize ACSF with the settings.php changes required for artifact.">
<target name="deploy:acsf:init" description="Re-initialize ACSF with the settings.php changes required for artifact." hidden="true">
<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" level="info" passthru="true"/>
</target>
Expand Down
4 changes: 2 additions & 2 deletions phing/tasks/properties.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</then>
</if>

<target name="echo-property" description="Echoes the value of a Phing property.">
<target name="echo-property" description="Echoes the value of a Phing property." hidden="true">
<fail unless="property.name" message="property.name must be set!"/>
<echo>${property.name}</echo>
<if>
Expand All @@ -47,7 +47,7 @@
</if>
</target>

<target name="echo-properties" description="Echoes the value of all Phing properties.">
<target name="echo-properties" description="Echoes the value of all Phing properties." hidden="true">
<echoproperties/>
</target>

Expand Down
7 changes: 4 additions & 3 deletions phing/tasks/validate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

<!-- Run all validation targets. -->
<target name="validate:all" description="Runs all code validation targets."
depends="validate:composer, validate:lint, validate:phpcs"/>
depends="validate:composer, validate:lint, validate:phpcs"
hidden="true" />

<!-- Verify that composer json and lock files are in sync. -->
<target name="validate:composer" description="Validate composer files.">
Expand All @@ -22,7 +23,7 @@
</target>

<!-- Run code sniffer against specific files. -->
<target name="validate:phpcs:files" description="">
<target name="validate:phpcs:files" description="" hidden="true">
<fail unless="files" message="Missing files parameter."/>
<property name="phpcs.ruleset" value="${repo.root}/vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml"/>

Expand All @@ -41,7 +42,7 @@
</if>
</target>

<target name="validate:phpcs:file" description="Runs PHP Code Sniffer against a specific file.">
<target name="validate:phpcs:file" description="Runs PHP Code Sniffer against a specific file." hidden="true">
<fail unless="file" message="Missing file parameter."/>
<property name="phpcs.ruleset" value="${repo.root}/vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml"/>
<phpcodesniffer
Expand Down

0 comments on commit 749c944

Please sign in to comment.