This is the implementation of a headless CMS for the data portal of the Municipality of Amsterdam where articles, publications and other editorial content will be published and maintained. This is based on the Drupal CMS enriched with Elasticsearch capabilities.
The CMS backend will be used by editors to publish the editorial content. The editorial content will be made available through the headless API of Drupal and integrated in the website Data en informatie (the data portal).
Use the Makefile commands to spin up the containers. Run make to list the available commands. Note that, to have the CMS fully functional, both the database dump and the site's configuration need to be imported/available.
Run the build command to spin up the database, drupal, imgproxy and elasticsearch containers:
make build
A postgress database export can be imported in the running database container by executing the command
make DB_FILE=db.gz import_db
An instance's configuration can be exported from {{CMS_URL}}/admin/config/development/configuration/full/export. The contents of that file should be unzipped into the app/config folder. Importing the configuration:
make import_config
IMPORTANT
After spinning importing a database or a set of configuration files, there can be a mismatch between the two and Drupal requires that the cache be cleared. When running into issues after importing the database or configuration, try to run the update command to fix any broken references:
make update
Drupal modules are not included in the repository's file structure, but instead should be handled by composer. New modules can be required by running
make composer command=require package=<package>
where <package> takes the form foo/bar or foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0".
Updating a module/package can be done by running
make composer command=update package=<package>
Modules (or plugins) can have entries in the database and will need to be uninstalled in the CMS' UI before they are removed from the composer.json file.
The Drupal core version is handled by Composer. Updating the Drupal core to the latest stable (minor or patch) version can be accomplished by running
make drupal_update
To upgrade the Drupal core major version, a couple of steps need to be taken:
- Change the Docker image name in the
Dockerfile - Update the versions in
composer.jsonof thedrupal/core-*dependencies and runmake composer command=update - Change the version reference in the
dataportaal.themefile in thethemes/custom/dataportaal/templatesfolder