Build and deployment configurations to stand-up a Drupal instance, backed by a MariaDB database, in OpenShift.
The project uses the openshift-developer-tools for processing the templates and provisioning the builds/deployment configurations.
To run the project in a local development environment, a Docker setup has been provided.
From the docker folder:
Execute ./manage build
to prepare the container images.
Execute ./manage start
to run the containers.
The Drupal site will be served on http://localhost:8080.
To locally test changes to the Drupal configuration, edit the files in docker/drupal/config. To locally test changes to the SOLR configuration, edit the files in solr/cores/lrb/conf.
To apply the changes, rebuild and restart the services using the manage
commands above.
All of the data saved to the app filesystem and database will be persisted until ./manage rm
is executed: this command is destructive, and will clean all of the docker containers/volumes.
Most changes to the OpenShift environment(s) can be applied simply by merging a pull request that includes changes to the app folder (for Drupal) or the solr/cores/lrb/conf for SOLR. The build-pipeline
will be triggered automatically on each merge event and, once the builds are completed, the changes will be deployed to the dev
environment.
To promote changes from dev
to test
run the deploy-to-test-pipeline
.
To promote changes from test
to prod
run the deploy-to-prod-pipeline
.
Pipelines can be accessed in the tools
namespace in OpenShift, direct link here.
The Drupal app has a couple of settings files that are customizable on a per-deployment basis, they can be found in openshift/templates/drupal/config.
php.ini
is shared across all of the environments (dev/test/prod
).
settings.php
is customizable on a per-environment basis.
.htaccess
is customizable on a per-environment basis.
To apply changes to these files in OpenShift:
Update the file that needs to be updated.
Log into the OCP and switch to the environment you wish to update.
From within the openshift folder, use the manage
script to update the deployed files, e.g.: ./manage -e dev deploy
to update the dev
environment.
Please Note: the manage
script extends functionality provided by the openshift-developer-tools and therefore requires them to be installed and on the path in order to work properly.
HTTP Basic Authentication is configured by adding the relevant section to the .htaccess
file.
The user credentials are stored in a secret named drupal-http-auth
in each namespace (dev/test/prod).
Please note that to enable a user for basic http authentication, the secret must be populated, otherwise the .htpasswd
file will remain empty and it will not be possible to access the website.