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

Toggle modules per environment. #700

Merged
merged 1 commit into from
Nov 22, 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
6 changes: 2 additions & 4 deletions phing/tasks/ci.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
<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"/>
<property name="environment" value="ci"/>
</phingcall>
</target>

Expand All @@ -39,8 +38,7 @@
<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}"/>
<property name="enable_property" value="modules.ci.enable"/>
<property name="uninstall_property" value="modules.ci.uninstall"/>
<property name="environment" value="ci"/>
</phingcall>
</target>
</project>
3 changes: 1 addition & 2 deletions phing/tasks/deploy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@

<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"/>
<param name="environment" value="deploy"/>
<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. -->
Expand Down
6 changes: 2 additions & 4 deletions phing/tasks/local-sync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
<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"/>
<param name="environment" value="local"/>
</phingcall>
</target>

Expand All @@ -35,8 +34,7 @@
<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"/>
<property name="environment" value="local"/>
</phingcall>
</target>

Expand Down
13 changes: 3 additions & 10 deletions phing/tasks/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@
<param>"install_configure_form.update_status_module='array(FALSE,FALSE)'"</param>
</drush>

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

<!-- Set sites directory file permissions. -->
Expand Down Expand Up @@ -274,7 +273,6 @@
</target>

<target name="setup:update" description="Update current database to reflect the state of the Drupal file system." depends="setup:config-import">
<!-- enable_property and uninstall_property must be set at this time. -->
<phingcall target="setup:toggle-modules"/>
</target>

Expand All @@ -286,19 +284,14 @@

<target name="setup:toggle-modules" description="Enables and uninstalls specified modules.">
<if>
<isset property="${enable_property}"/>
<isset property="${environment}"/>
<then>
<drush command="pm-enable" assume="yes">
<param>${${enable_property}}</param>
<param>${modules.${environment}.enable}</param>
<option name="skip"></option>
</drush>
</then>
</if>
<if>
<isset property="${uninstall_property}"/>
<then>
<drush command="pm-uninstall" assume="yes">
<param>${${uninstall_property}}</param>
<param>${modules.${environment}.uninstall}</param>
</drush>
</then>
</if>
Expand Down
2 changes: 1 addition & 1 deletion scripts/cloud-hooks/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ deploy_updates() {
export PATH=$repo_root/vendor/bin:$PATH
cd $repo_root

blt deploy:update
blt deploy:update -Denvironment=$target_env
if [ $? -ne 0 ]; then
echo "Update errored."
status=1;
Expand Down
15 changes: 14 additions & 1 deletion template/blt/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,20 @@ modules:
uninstall:
- acquia_connector
- shield
deploy:
dev:
enable:
- acquia_connector
- shield
uninstall: []
test:
enable:
- acquia_connector
- shield
uninstall:
- devel
- field_ui
- views_ui
prod:
enable:
- acquia_connector
- shield
Expand Down