Skip to content

Commit

Permalink
Allow skipping drupal install for drupal-skeleton tests. not a great …
Browse files Browse the repository at this point in the history
…solution, but...
  • Loading branch information
becw committed Apr 4, 2019
1 parent ee7daa6 commit e7e44eb
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions targets/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,30 +195,36 @@
<phing dir="${application.startdir}" target="build" inheritAll="false" />

<!-- If Drupal has a database connection available, offer to install Drupal. -->
<trycatch>
<try>
<!-- The 'haltonfailure' attribute seems to have the opposite behavior
from what is described in the Phing documentation. -->
<phing dir="${application.startdir}" target="drupal-has-database-connection" inheritAll="false" haltonfailure="true" />

<!-- This code will run only when a database connection is available. -->
<input propertyName="install_now" validArgs="y,n" message="Install Drupal now " promptChar="?" />
<if>
<equals arg1="${install_now}" arg2="y" />
<then>
<phing dir="${application.startdir}" target="drupal-first-install" inheritAll="false" />
</then>
</if>
</try>
<catch>
<!-- Drupal will be installed later, if not manually then by the 'install'
target in the default build.xml. -->
<echo>Skipping Drupal installation, since the database is not available.
<!-- ... but allow skipping this, specifically for the drupal-skeleton tests. -->
<if>
<not><isset property="skip-install-drupal" /></not>
<then>
<trycatch>
<try>
<!-- The 'haltonfailure' attribute seems to have the opposite behavior
from what is described in the Phing documentation. -->
<phing dir="${application.startdir}" target="drupal-has-database-connection" inheritAll="false" haltonfailure="true" />

<!-- This code will run only when a database connection is available. -->
<input propertyName="install_now" validArgs="y,n" message="Install Drupal now " promptChar="?" />
<if>
<equals arg1="${install_now}" arg2="y" />
<then>
<phing dir="${application.startdir}" target="drupal-first-install" inheritAll="false" />
</then>
</if>
</try>
<catch>
<!-- Drupal will be installed later, if not manually then by the 'install'
target in the default build.xml. -->
<echo>Skipping Drupal installation, since the database is not available.

From within a development environment, you can run `phing install` to install Drupal.
</echo>
</catch>
</trycatch>
</echo>
</catch>
</trycatch>
</then>
</if>

<!-- Whitespace is intentional. -->
<echo>
Expand Down

0 comments on commit e7e44eb

Please sign in to comment.