Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PL-47: D8 domain map #14

Closed
wants to merge 16 commits into from
Closed
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
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ If you update Vagrant, you may need to update your vagrant plugins with `vagrant
6. Build the `/src` directory and symlink modules there to make development easier: `phing init`
7. Visit your D8 (standalone) site at [http://d8.fs-demo.local](http://d8.fs-demo.local)
8. Visit your D8 (domain access) site at:
- [http://fs-demo.d8-1.local](http://d8-1.fs-demo.local)
- [http://d8-1.fs-demo.local](http://d8-1.fs-demo.local)
- [http://d8-2.fs-demo.local](http://d8-2.fs-demo.local)
- [http://d8-3.fs-demo.local](http://d8-3.fs-demo.local)
- These sites are for future use, as Domain support has not yet been ported to D8.
9. Visit your D7 site at [http://d7.fs-demo.local](http://d7.fs-demo.local)
10. View the Solr index at [http://federated-search-demo.local:8983/solr/#/drupal8/query](http://federated-search-demo.local:8983/solr/#/drupal8/query).
9. Visit your D7 (standalone) site at [http://d7.fs-demo.local](http://d7.fs-demo.local)
10. Visit your D7 (domain access) site at:
- [http://d7-1.fs-demo.local](http://d7-1.fs-demo.local)
- [http://d7-2.fs-demo.local](http://d7-2.fs-demo.local)
- [http://d7-3.fs-demo.local](http://d7-3.fs-demo.local)
11. View the Solr index at [http://federated-search-demo.local:8983/solr/#/drupal8/query](http://federated-search-demo.local:8983/solr/#/drupal8/query).

You can log in to any of the Drupal sites at `/user` with `admin/admin`.

Expand Down
119 changes: 69 additions & 50 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<phingcall target="drupal-build" inheritAll="false">
<property name="build.env" value="d8-domain" />
</phingcall>

<phingcall target="drupal-build" inheritAll="false">
<property name="build.env" value="d7-domain" />
</phingcall>
</target>

<target name="install-drupal-at-root" description="Install Drupal at a specific docroot.">
Expand Down Expand Up @@ -100,6 +104,15 @@

<phingcall target="install-drupal-at-root" />

<!-- Import config to fix rogue blocks changing UUIDs -->
<drush command="config-import" assume="yes" root="${build.dir}/${drupal.root}" uri="${drupal.uri}"/>

<!-- Rebuild node access permissions. No direct drush command for this
as per https://www.drupal.org/project/devel/issues/2677218#comment-10907984 -->
<drush command="php-eval" root="${build.dir}/${drupal.root}" uri="${drupal.uri}">
<param>'node_access_rebuild();'</param>
</drush>

<!-- Uninstall the module -->
<drush command="pm-uninstall" assume="yes" root="${build.dir}/${drupal.root}" uri="${drupal.uri}">
<param>demo_umami_content</param>
Expand All @@ -116,36 +129,69 @@
<drush command="pm-uninstall" assume="yes" root="${build.dir}/${drupal.root}" uri="${drupal.uri}">
<param>federated_terms</param>
</drush>
<!-- Index content in Solr -->
<drush command="sapi-c" assume="yes" root="${build.dir}/${drupal.root}" uri="${drupal.uri}">
<param>federated_search</param>
</drush>
<drush command="sapi-i" assume="yes" root="${build.dir}/${drupal.root}" uri="${drupal.uri}">
<param>federated_search</param>
</drush>

<!-- Import config to fix rogue blocks changing UUIDs -->
<drush command="config-import" assume="yes" root="${build.dir}/${drupal.root}" uri="${drupal.uri}"/>

<!-- Rebuild node acces permissions. No direct drush command for this
as per https://www.drupal.org/project/devel/issues/2677218#comment-10907984 -->
<drush command="php-eval" root="${build.dir}/${drupal.root}" uri="${drupal.uri}">
<param>'node_access_rebuild();'</param>
</drush>

</target>

<!-- Target: install -->
<target name="install-d7" description="Install the D7 site.">
<property name="build.env" value="d7" override="true" />
<fail message="Please run 'phing install-d7' with either '-Dbuild.env=d7' or '-Dbuild.env=d7-domain'.">
<condition>
<equals arg1="${build.env}" arg2="vagrant" casesensitive="true" />
</condition>
</fail>

<property file="${build.dir}/conf/build.${build.env}.properties" override="true" />

<exec command="composer install" dir="${build.dir}/${drupal.root}/../" passthru="true" />

<!-- Pre install Domain Access settings.php install
Because Domain Access prevents Drush install with it's settings.php include, we will overwrite the settings.php file with the default one and then after install enable domain access.
-->
<if>
<isset property="build.drupal.settings_post_install" />
<then>
<!-- Make the sites directory writable. -->
<chmod file="${build.dir}/${drupal.root}/sites/${drupal.sites_subdir}" mode="777" />
<!-- Copy over the pre-install file. -->
<phingcall target="drupal-prepare-settings">
<!-- Rebuild the settings file property value. -->
<property name="build.drupal.settings_dest" value="${drupal.root}/sites/${drupal.sites_subdir}/settings.php" override="true" />
</phingcall>
</then>
</if>
<!-- End of domain access pre-install settings.php copy. -->

<drush command="site-install" assume="yes" root="${build.dir}/${drupal.root}" uri="${drupal.uri}">
<option name="site-name">Federated SOLR D7</option>
<option name="site-name">Federated Search Demo D7</option>
<option name="account-pass">admin</option>
<param>standard</param>
</drush>

<!-- Post install Domain Access settings.php overwrites. -->
<if>
<isset property="build.drupal.settings_post_install" />
<then>
<!-- Make the sites directory writable. -->
<chmod file="${build.dir}/${drupal.root}/sites/${drupal.sites_subdir}" mode="777" />
<!-- Copy over the post-install file. -->
<phingcall target="drupal-prepare-settings">
<property name="build.drupal.settings" value="${build.drupal.settings_post_install}" override="true" />
<!-- Rebuild the settings file property value. -->
<property name="build.drupal.settings_dest" value="${drupal.root}/sites/${drupal.sites_subdir}/settings.php" override="true" />
</phingcall>
<!-- Restore post install folder / file permissions. -->
<chmod file="${build.dir}/${drupal.root}/sites/${drupal.sites_subdir}" mode="555" />
<chmod file="${build.dir}/${drupal.root}/sites/${drupal.sites_subdir}/settings.php" mode="444" />
</then>
</if>
<!-- End of domain access pre-install settings.php copy. -->

<drush command="pm-enable" assume="yes" root="${build.dir}/${drupal.root}" uri="${drupal.uri}">
<param>features_search_api_config</param>
</drush>
Expand All @@ -162,14 +208,24 @@
</target>

<target name="install-all" description="Install all the sites.">
<echo message="It's best to clear your Solr index before you rebuild all the things." />
<phingcall target="solr-clear" />

<phingcall target="install-d8">
<property name="build.env" value="d8" override="true" />
</phingcall>
<phingcall target="install-d7" />

<phingcall target="install-d8">
<property name="build.env" value="d8-domain" override="true" />
</phingcall>

<phingcall target="install-d7">
<property name="build.env" value="d7" override="true" />
</phingcall>

<phingcall target="install-d7">
<property name="build.env" value="d7-domain" override="true" />
</phingcall>
</target>

<!-- Target: init -->
Expand Down Expand Up @@ -222,41 +278,4 @@
</if>
</target>

<!-- Target: migrate -->
<target name="migrate" description="Run the migrations.">
<echo>Configure this target to load sample data and run the migrations.</echo>
</target>


<!-- Target: test -->
<target name="test" description="Run all the tests.">
<echo>Configure this target to run the tests.</echo>
<!-- You may want to include one or more of the commands from the 'code-review' target here. -->
</target>


<!-- Target: code-review -->
<target name="code-review" description="Run the automated code reviews.">
<!-- These are called directly rather than using <import> because they are single-purpose task files. -->
<phing phingfile="${build.dir}/vendor/palantirnet/the-build/tasks/code_review/drupal_code_sniffer.xml" />
<phing phingfile="${build.dir}/vendor/palantirnet/the-build/tasks/code_review/phpmd.xml" />
<phing phingfile="${build.dir}/vendor/palantirnet/the-build/tasks/code_review/phplint.xml" />
</target>


<!-- Target: deploy -->
<target name="deploy" description="Build and deploy the application.">
<echo>Configure this target to build the production artifact; see the `deploy-to-acquia` target for an example.</echo>
</target>


<!-- Target: deploy-to-acquia -->
<target name="deploy-to-acquia">
<phingcall target="check-deploy-env" />
<phingcall target="acquia-build" />
<phingcall target="build" />
<phingcall target="acquia-deploy" />
</target>


</project>
17 changes: 17 additions & 0 deletions conf/build.d7-domain.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
build.artifact_mode=symlink
build.drupal.settings=conf/drupal/settings.d7.php
build.drupal.settings_post_install=conf/drupal/settings.d7-domain.php
build.test_output=/dev/null
drupal.site_name=FS Demo D7 Domain
drupal.profile=standard
drupal.modules_enable=
drupal.database.database=fs-demo-d7-domain
drupal.database.username=root
drupal.database.password=root
drupal.database.host=127.0.0.1
drupal.settings.file_public_path=sites/default/files
drupal.settings.file_private_path=
drupal.twig.debug=
drupal.uri=http://d7-1.fs-demo.local
drupal.hash_salt=528a2e810ba1473af9118387b9ebb9fbe5634047cff5ab3bb29cc360dbf25c7a
drupal.root=web/d7-domain/docroot
2 changes: 1 addition & 1 deletion conf/build.d7.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ drupal.database.host=127.0.0.1
drupal.settings.file_public_path=sites/default/files
drupal.settings.file_private_path=
drupal.twig.debug=
drupal.uri=http://fs-demo.d7.local
drupal.uri=http://d7.fs-demo.local
drupal.hash_salt=528a2e810ba1473af9118387b9ebb9fbe5634047cff5ab3bb29cc360dbf25c7a
drupal.root=web/d7/docroot
2 changes: 1 addition & 1 deletion conf/build.d8-domain.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ drupal.database.host=127.0.0.1
drupal.settings.file_public_path=sites/default/files
drupal.settings.file_private_path=
drupal.twig.debug=
drupal.uri=http://fs-demo.d8-1.local
drupal.uri=http://d8-1.fs-demo.local
drupal.hash_salt=528a2e810ba1473af9118387b9ebb9fbe5634047cff5ab3bb29cc360dbf25c7a
drupal.root=web/d8-domain/docroot
drupal.config_sync_directory=../../../config/sites/d8
2 changes: 1 addition & 1 deletion conf/build.d8.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ drupal.database.host=127.0.0.1
drupal.settings.file_public_path=sites/default/files
drupal.settings.file_private_path=
drupal.twig.debug=
drupal.uri=http://fs-demo.d8.local
drupal.uri=http://d8.fs-demo.local
drupal.hash_salt=528a2e810ba1473af9118387b9ebb9fbe5634047cff5ab3bb29cc360dbf25c7a
drupal.root=web/d8/docroot
drupal.config_sync_directory=../../../config/sites/d8
28 changes: 28 additions & 0 deletions conf/drupal/settings.d7-domain.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

$databases = array();
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => '${drupal.database.database}',
'username' => '${drupal.database.username}',
'password' => '${drupal.database.password}',
'host' => '${drupal.database.host}',
'prefix' => '',
);

$conf['file_public_path'] = '${drupal.settings.file_public_path}';
$conf['file_private_path'] = '${drupal.settings.file_private_path}';
$conf['file_temporary_path'] = '/tmp';

$config['acquia_connector.settings']['hide_signup_messages'] = TRUE;

/**
* Add the domain module setup routine.
*/
include DRUPAL_ROOT . '/sites/all/modules/contrib/domain/settings.inc';

$cookie_domain = '.fs-demo.local';

if (file_exists(__DIR__ . '/settings.local.php')) {
include __DIR__ . '/settings.local.php';
}
Loading