Version: {{ VERSION }}
This script automates the installation and configuration of CivicTheme, the civictheme_govcms support module, and a new custom subtheme within your GovCMS project.
- GovCMS Project: You must have a GovCMS project / scaffold already set up.
- Ahoy:
ahoymust be installed and configured for your project (i.e., you can runahoycommands). - Docker: Docker must be running, as
ahoytypically interacts with Docker containers. tarandcurl: These command-line utilities must be available in your shell environment where you run the script.- Bash: The script is written for Bash.
The script will perform the following actions:
- Download and extract the specified CivicTheme version into
themes/custom/civictheme. - Run initial CivicTheme provisioning commands.
- Clear Drupal caches.
- Enable CivicTheme and set it as the default theme temporarily.
- Download, install, configure, and then uninstall and remove the
civictheme_govcmsmodule (as per the specified workflow). - Generate a new subtheme based on CivicTheme using the provided names and description.
- Enable the new subtheme and set it as the site's default theme.
After the script completes successfully, your new subtheme will be active and ready for customisation in themes/custom/<your_subtheme_machine_name>.
- Download and Setup the Script:
From your GovCMS project root directory, run:
curl -o setup_civictheme.sh \ https://raw.githubusercontent.com/civictheme/civictheme_govcms/refs/heads/main/scripts/setup_civictheme.sh \ && chmod +x setup_civictheme.sh
Note: Download the script to your GovCMS project root directory on your host machine (not inside a Docker container).
-
Run the Script: Execute the script from your GovCMS project's root directory. You'll need to provide values for all the required arguments.
Command Structure:
./setup_civictheme.sh -c <civictheme_version> \ -g <govcms_module_ref> \ -m <subtheme_machine_name> \ -u "<subtheme_human_name>" \ -d "<subtheme_description>" \ [-n] \ [-p]
Note: Make sure to run the script from your GovCMS project root directory on your host machine (not inside a Docker container).
- After completing installation, delete the
setup_civictheme.shfile from your repository.
Arguments:
-c <civictheme_version>: (Required) The version of the CivicTheme base theme to download (e.g., "1.11.0").-g <govcms_module_ref>: (Required) The Git reference (branch or tag) for thecivictheme_govcmsmodule.- For a branch: e.g., "main"
- For a tag: e.g., "1.0.1" or "v1.0.1"
-m <subtheme_machine_name>: (Required) The machine-readable name for your new subtheme. Use lowercase letters, numbers, and hyphens/underscores (e.g., "my_custom_site_theme").-u "<subtheme_human_name>": (Required) The human-readable name for your new subtheme. Enclose in quotes if it contains spaces (e.g., "My Custom Site Theme").-d "<subtheme_description>": (Required) A short description for your new subtheme. Enclose in quotes (e.g., "A custom theme for My Awesome GovCMS Project").-n: (Optional) Skip content provisioning. By default, the script will provision demo content. Use this flag to skip that step.-p: (Optional) Apply Drupal cache backend patch (drupal.org issue). This patches LayoutPluginManager to add cache tags for better cache invalidation.
-
Example:
./setup_civictheme.sh -c "{{ VERSION }}" \ -g "main" \ -m "my_gov_project_theme" \ -u "My Gov Project Theme" \ -d "Custom theme for the My Gov Project website on GovCMS."
./setup_civictheme.sh \ -c "1.11.0" \ -g "{{ VERSION }}" \ -m "my_gov_theme" \ -u "My Awesome Gov Theme" \ -d "A custom subtheme for GovCMS." \ -p
To skip content provisioning:
./setup_civictheme.sh \ -c "1.11.0" \ -g "{{ VERSION }}" \ -m "my_gov_theme" \ -u "My Awesome Gov Theme" \ -d "A custom subtheme for GovCMS." \ -n
-
View Help: For a reminder of the options and usage:
./setup_civictheme.sh -h
These instructions are not needed if you are using the automated script.
- Enable module
- Run Drush
drush civictheme_govcms:remove-configcommand to remove GovCMS configurations.
Remove all GovCMS configurations:
drush civictheme_govcms:remove-config
Remove all GovCMS configurations, but preserve media_types
and content_types:
drush civictheme_govcms:remove-config --preserve=media_types,content_types
List of --preserve options:
media_typestext_formatfieldscontent_typesvocabulariesuser_rolesmenuspathauto_patterns