Connects the site to a contentpool.
The contentpool distribution combines the publishing features of the Thunder distribution with powerful content API & replication features! https://www.drupal.org/project/contentpool, (*1)
The distribution proved itself very valuable, but it turned out that replication via multiversion is too complex for our use-case - so we switched to a simpler approach., (*3)
If you like to continue maintaining the distribution, please get in touch!, (*4)
This repository is a Drupal client module that can connect to a contentpool server. You'll need a drupal project for installing it. Refer to "Installation" for details., (*5)
Please refer to the quick installation instructions of the distribution at https://github.com/drunomics/contentpool#quick-installation., (*6)
Install the module and it's dependencies as usual. It's recommended to do so via composer. This requires a composer-enabled Drupal projects, e.g. as provided by http://github.com/drunomics/drupal-project., (*7)
composer require drunomics/contentpool-client drush en contentpool_client -y
Configure the module to point to your contentpool instance. This can be done via the automated configruation or manually as following., (*8)
Just run the provided drush command and provide it with the contentpool URL.
Be sure to provide correct authentication credentials of the replicator user
and to append the path /relaxed
to your contentpool's base URL:, (*9)
drush cps http://replicator:YOURPASS@example.contentpool-project.localdev.space/relaxed
The drush command will check the connection to the contentpool and output errors if there are connection issues., (*10)
Add a new "replicator" user for replication and grant it the "replicator" role. It will be used by the replication process to create the data via the CouchDB compatible /relaxedws API endpoint., (*11)
Set the "replicator" user and its password admin/config/relaxed/settings
.
Do not change the API root., (*12)
Add a new remote service "Contentpool" at admin/config/services/relaxed/add
and enter the remote URL, including the /relaxedws suffix. After submitting
the form, the connection will be checked. If there are no inidicated problems,
it worked fine., (*13)
Configure the live workspace at admin/structure/workspace/
as follows:, (*14)
That's it!, (*15)
For the contentpool filter selection, there is a dependency on Vue 2.5.17 or later. Vue.js is loaded automatically via the pre-configured library of the vuejs module., (*16)
The module configures all dependencies needed to replicate content from the contentpool. That is, the necessary data model and the modules needed for the replication. See http://www.drupaldeploy.org/ for more info about this modules., (*17)
The client can pull data automatically on a regular basis, or one can initiate the data replication process manually. Finally, the client provides an API endpoint which allows the contentpool to initiate an update instantly after changes occurred., (*18)
Just run the following command (requires Drush 9):, (*19)
drush cppull
As admin you should see an "Update" button in the top right corner of the toolbar. Use it to initiate an update., (*20)
Once done so, cron must be invoked to actually perform the replication. Do so; e.g. via the "Run cron" button at admin/reports/status., (*21)
The contentpool client can be configured to update content from configured contentpool remote servers. The following options are possible:, (*22)
In the configuration for a remote a pull interval can be specified. On a cron run the interval will be checked and a pull scheduled if necessary. The pull will run automatically at the end of cron execution, when Drupal processes the workspace replication queue., (*23)
The update can be triggered manually using the contentpool-client:pull-content
command. It will pull from all remote servers that are marked as a Contentpool., (*24)
For example:, (*25)
drush cppull
# Pull content from contentpool: drush cppull # Show last replication status: drush cpst # Unblock replication status: drush cpun # Check whether somethings needs to be pulled: drush contentpool-client:check # Reset replication history, i.e. re-replicate everything: drush cpr # Remove conflicting revisions: drush contentpool-client:remove-conflicts
When there are replication problems, be sure to:, (*26)
DELETE FROM flood;
.For development purposes one can use the provided docker-compose setup. This is exactly the same setup as it's used by automated tests., (*27)
First, ensure do you do not use docker-composer version 1.21, as it contains this regression: https://github.com/docker/compose/issues/5874, (*28)
docker-compose --version
If so, update to version 1.22 which is known to work. See https://github.com/docker/compose/releases/tag/1.22.0, (*29)
./scripts/create-project.sh ./scripts/run-server.sh ./scripts/init-project.sh # Optionally, launch a pool instance. ./scripts/launch-contentpool.sh
Just follow the above installation instructions and edit the module content at web/modules/contrib/contentpool-client. You can make sure it's a Git checkout by doing:, (*30)
rm -rf web/modules/contrib/contentpool-client composer install --prefer-source
After installation with the provided scripts (see above) you can just launch the tests as the following:, (*31)
./scripts/create-project.sh ./scripts/run-server.sh ./scripts/init-project.sh ./scripts/launch-contentpool.sh ./scripts/run-tests.sh
Based upon the manual installation instructions you can launch tests with the following helper script:, (*32)
./web/modules/contrib/contentpool-client/tests/behat/run.sh
You might have to set some environment variables for it to work. It needs a running a chrome with remote debugging enabled. Set the CHROME_URL variable., (*33)