Skip to content

Commit 491b908

Browse files
grasmashdreamfony
authored andcommitted
Fixing toggle-modules targets. (acquia#644)
* Fixing toggle-modules targets. * Calling toggle modules within setup and setup:update targets.
1 parent ce24502 commit 491b908

File tree

5 files changed

+38
-31
lines changed

5 files changed

+38
-31
lines changed

phing/tasks/ci.xml

+4-7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
<phingcall target="setup">
1515
<property name="drush.alias" value="${drush.aliases.ci}"/>
1616
<property name="create_alias" value="n"/>
17+
<property name="enable_property" value="modules.ci.enable"/>
18+
<property name="uninstall_property" value="modules.ci.uninstall"/>
1719
</phingcall>
1820
</target>
1921

@@ -37,13 +39,8 @@
3739
<target name="ci:update" description="Update current database to reflect the state of the Drupal file system; uses ci drush alias." hidden="true">
3840
<phingcall target="setup:update">
3941
<property name="drush.alias" value="${drush.aliases.ci}"/>
40-
</phingcall>
41-
</target>
42-
43-
<target name="ci:toggle-modules" description="Enables modules.ci.enable projects and uninstalls modules.ci.uninstall projects.">
44-
<phingcall target="setup:toggle-modules">
45-
<param name="enable" value="${modules.ci.enable}"/>
46-
<param name="uninstall" value="${modules.ci.uninstall}"/>
42+
<property name="enable_property" value="modules.ci.enable"/>
43+
<property name="uninstall_property" value="modules.ci.uninstall"/>
4744
</phingcall>
4845
</target>
4946
</project>

phing/tasks/deploy.xml

+3-8
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,14 @@
157157
</delete>
158158
</target>
159159

160-
<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">
160+
<target name="deploy:update" description="Update current database to reflect the state of the Drupal file system; uses local drush alias.">
161161
<phingcall target="setup:update">
162+
<param name="enable_property" value="modules.deploy.enable"/>
163+
<param name="uninstall_property" value="modules.deploy.uninstall"/>
162164
<property name="drush.alias" value="self"/>
163165
<!-- Most sites store their version-controlled configuration in /config/default. -->
164166
<!-- ACE internally sets the vcs configuration directory to /config/default, so we use that. -->
165167
<property name="cm.core.config-dir" value="vcs"/>
166168
</phingcall>
167169
</target>
168-
169-
<target name="deploy:toggle-modules" description="Enables modules.deploy.enable projects and uninstalls modules.deploy.uninstall projects.">
170-
<phingcall target="setup:toggle-modules">
171-
<param name="enable" value="${modules.deploy.enable}"/>
172-
<param name="uninstall" value="${modules.deploy.uninstall}"/>
173-
</phingcall>
174-
</target>
175170
</project>

phing/tasks/local-sync.xml

+6-9
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88

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

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

@@ -30,16 +32,11 @@
3032
<drush command="cache-rebuild"/>
3133
</target>
3234

33-
<target name="local:toggle-modules" description="Enables modules.local.enable projects and uninstalls modules.local.uninstall projects.">
34-
<phingcall target="setup:toggle-modules">
35-
<param name="enable" value="${modules.local.enable}"/>
36-
<param name="uninstall" value="${modules.local.uninstall}"/>
37-
</phingcall>
38-
</target>
39-
40-
<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">
35+
<target name="local:update" description="Update current database to reflect the state of the Drupal file system; uses local drush alias.">
4136
<phingcall target="setup:update">
4237
<property name="drush.alias" value="${drush.aliases.local}"/>
38+
<property name="enable_property" value="modules.local.enable"/>
39+
<property name="uninstall_property" value="modules.local.uninstall"/>
4340
</phingcall>
4441
</target>
4542

phing/tasks/setup.xml

+24-7
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@
158158

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

161+
<!-- enable_property and uninstall_property must be set at this time. -->
162+
<phingcall target="setup:update"/>
163+
161164
<!-- Set sites directory file permissions. -->
162165
<echo>Making ${docroot}/sites/default writable.</echo>
163166
<chmod mode="0755" failonerror="false">
@@ -225,6 +228,10 @@
225228
</target>
226229

227230
<target name="setup:update" description="Update current database to reflect the state of the Drupal file system.">
231+
232+
<!-- enable_property and uninstall_property must be set at this time. -->
233+
<phingcall target="setup:toggle-modules"/>
234+
228235
<!-- Import configuration before executing updates, in case any db updates are dependent on new configs to be imported. -->
229236
<drush command="config-import" assume="yes" alias="${drush.alias}">
230237
<option name="partial"></option>
@@ -265,13 +272,23 @@
265272
</target>
266273

267274
<target name="setup:toggle-modules" description="Enables and uninstalls specified modules.">
268-
<drush command="pm-enable" assume="yes">
269-
<param>${enable}</param>
270-
<option>skip</option>
271-
</drush>
272-
<drush command="pm-uninstall" assume="yes">
273-
<param>${uninstall}</param>
274-
</drush>
275+
<if>
276+
<isset property="${enable_property}"/>
277+
<then>
278+
<drush command="pm-enable" assume="yes">
279+
<param>${${enable_property}}</param>
280+
<option name="skip"></option>
281+
</drush>
282+
</then>
283+
</if>
284+
<if>
285+
<isset property="${uninstall_property}"/>
286+
<then>
287+
<drush command="pm-uninstall" assume="yes">
288+
<param>${${uninstall_property}}</param>
289+
</drush>
290+
</then>
291+
</if>
275292
</target>
276293

277294
</project>

template/composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
}
99
],
1010
"require": {
11+
1112
"cweagans/composer-patches": "dev-master#5456199acdcc16b243814aa45259f4c56272a634 as 1.5.0",
1213
"drupal/acquia_connector": "^8.1.5",
1314
"drupal/acsf": "^8.1.32",

0 commit comments

Comments
 (0)