Skip to content

Commit

Permalink
Fixing toggle-modules targets. (#644)
Browse files Browse the repository at this point in the history
* Fixing toggle-modules targets.

* Calling toggle modules within setup and setup:update targets.
  • Loading branch information
grasmash authored Nov 9, 2016
1 parent 6c680db commit d345c86
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 31 deletions.
11 changes: 4 additions & 7 deletions phing/tasks/ci.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<phingcall target="setup">
<property name="drush.alias" value="${drush.aliases.ci}"/>
<property name="create_alias" value="n"/>
<property name="enable_property" value="modules.ci.enable"/>
<property name="uninstall_property" value="modules.ci.uninstall"/>
</phingcall>
</target>

Expand All @@ -37,13 +39,8 @@
<target name="ci:update" description="Update current database to reflect the state of the Drupal file system; uses ci drush alias." hidden="true">
<phingcall target="setup:update">
<property name="drush.alias" value="${drush.aliases.ci}"/>
</phingcall>
</target>

<target name="ci:toggle-modules" description="Enables modules.ci.enable projects and uninstalls modules.ci.uninstall projects.">
<phingcall target="setup:toggle-modules">
<param name="enable" value="${modules.ci.enable}"/>
<param name="uninstall" value="${modules.ci.uninstall}"/>
<property name="enable_property" value="modules.ci.enable"/>
<property name="uninstall_property" value="modules.ci.uninstall"/>
</phingcall>
</target>
</project>
11 changes: 3 additions & 8 deletions phing/tasks/deploy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,14 @@
</delete>
</target>

<target name="deploy:update" description="Update current database to reflect the state of the Drupal file system; uses local drush alias." depends="deploy:toggle-modules">
<target name="deploy:update" description="Update current database to reflect the state of the Drupal file system; uses local drush alias.">
<phingcall target="setup:update">
<param name="enable_property" value="modules.deploy.enable"/>
<param name="uninstall_property" value="modules.deploy.uninstall"/>
<property name="drush.alias" value="self"/>
<!-- 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" value="vcs"/>
</phingcall>
</target>

<target name="deploy:toggle-modules" description="Enables modules.deploy.enable projects and uninstalls modules.deploy.uninstall projects.">
<phingcall target="setup:toggle-modules">
<param name="enable" value="${modules.deploy.enable}"/>
<param name="uninstall" value="${modules.deploy.uninstall}"/>
</phingcall>
</target>
</project>
15 changes: 6 additions & 9 deletions phing/tasks/local-sync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@

<target name="local:refresh" description="Refreshes local environment from upstream testing database." depends="setup:build, local:sync, local:update"/>

<target name="local:setup" description="Install dependencies, builds docroot, installs Drupal; uses local drush alias." depends="local:toggle-modules">
<target name="local:setup" description="Install dependencies, builds docroot, installs Drupal; uses local drush alias.">
<phingcall target="setup">
<property name="drush.alias" value="${drush.aliases.local}" />
<param name="enable_property" value="modules.local.enable"/>
<param name="uninstall_property" value="modules.local.uninstall"/>
</phingcall>
</target>

Expand All @@ -30,16 +32,11 @@
<drush command="cache-rebuild"/>
</target>

<target name="local:toggle-modules" description="Enables modules.local.enable projects and uninstalls modules.local.uninstall projects.">
<phingcall target="setup:toggle-modules">
<param name="enable" value="${modules.local.enable}"/>
<param name="uninstall" value="${modules.local.uninstall}"/>
</phingcall>
</target>

<target name="local:update" description="Update current database to reflect the state of the Drupal file system; uses local drush alias." depends="local:toggle-modules">
<target name="local:update" description="Update current database to reflect the state of the Drupal file system; uses local drush alias.">
<phingcall target="setup:update">
<property name="drush.alias" value="${drush.aliases.local}"/>
<property name="enable_property" value="modules.local.enable"/>
<property name="uninstall_property" value="modules.local.uninstall"/>
</phingcall>
</target>

Expand Down
31 changes: 24 additions & 7 deletions phing/tasks/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@

<phingcall target="setup:config-import"/>

<!-- enable_property and uninstall_property must be set at this time. -->
<phingcall target="setup:update"/>

<!-- Set sites directory file permissions. -->
<echo>Making ${docroot}/sites/default writable.</echo>
<chmod mode="0755" failonerror="false">
Expand Down Expand Up @@ -225,6 +228,10 @@
</target>

<target name="setup:update" description="Update current database to reflect the state of the Drupal file system.">

<!-- enable_property and uninstall_property must be set at this time. -->
<phingcall target="setup:toggle-modules"/>

<!-- Import configuration before executing updates, in case any db updates are dependent on new configs to be imported. -->
<drush command="config-import" assume="yes" alias="${drush.alias}">
<option name="partial"></option>
Expand Down Expand Up @@ -265,13 +272,23 @@
</target>

<target name="setup:toggle-modules" description="Enables and uninstalls specified modules.">
<drush command="pm-enable" assume="yes">
<param>${enable}</param>
<option>skip</option>
</drush>
<drush command="pm-uninstall" assume="yes">
<param>${uninstall}</param>
</drush>
<if>
<isset property="${enable_property}"/>
<then>
<drush command="pm-enable" assume="yes">
<param>${${enable_property}}</param>
<option name="skip"></option>
</drush>
</then>
</if>
<if>
<isset property="${uninstall_property}"/>
<then>
<drush command="pm-uninstall" assume="yes">
<param>${${uninstall_property}}</param>
</drush>
</then>
</if>
</target>

</project>
1 change: 1 addition & 0 deletions template/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
}
],
"require": {

"cweagans/composer-patches": "dev-master#5456199acdcc16b243814aa45259f4c56272a634 as 1.5.0",
"drupal/acquia_connector": "^8.1.5",
"drupal/acsf": "^8.1.32",
Expand Down

0 comments on commit d345c86

Please sign in to comment.