The main focus for this month's Melbourne Drupal Meetup was a presentation by Ivan Zugec from Salsa Digital. Ivan demonstrated an open-source script that automates the installation of Civic for , transforming a complex, multi-step manual process into a single command.
Automating Civic Theme setup for GovCMS - a summary
Setting up Civic Theme in GovCMS involves multiple manual steps that can slow down adoption and create room for configuration errors. Ivan Zugec tackled this problem by creating an automated installation script that reduces the entire setup process to a single command.
The project started when Ivan was tasked with making Civic Theme easier to deploy on GovCMS. The existing documentation outlined numerous setup steps that developers had to follow manually. By automating these steps, Ivan aimed to lower the barrier to entry and increase Civic Theme adoption across GovCMS projects.
His approach involved first working through the manual setup process to understand each component, then breaking those steps into a single executable script. The result is an open-source tool hosted on at the civic_theme_govcms repository. Developers can now specify their theme version, provide basic configuration details and run one command to get a working Civic Theme installation.
Simplifying Civic Theme adoption in GovCMS
The official Civic documentation lists numerous configuration steps that developers must complete manually. This creates friction during setup and can discourage teams from adopting the theme, particularly when starting new projects or onboarding developers who aren't familiar with the process.
Ivan's script addresses this by consolidating all setup tasks into a single automated workflow. The script handles theme installation, configuration and compilation without requiring developers to manually execute each step. This approach makes Civic Theme more accessible to teams and reduces the time needed to start building with the theme.
The script is hosted as an open-source project on GitHub, allowing the community to contribute improvements and adapt it for different use cases. To run it, developers need to specify a few parameters: the Civic Theme version, the GovCMS module reference (which can be a tagged release or branch) and standard Drupal theme details, such as machine name, human-readable name and description.
How the installation script works
The script accepts several parameters that control the installation. Developers specify the Civic Theme version they want to use and a reference for the GovCMS module that integrates Civic Theme with GovCMS. This reference can be a tagged version or a branch name. The script also requires standard Drupal theming information: the sub-theme's machine name, human-readable name and description.
A critical component is the patch option (specified with -P). GovCMS SaaS environments need a specific patch to handle configuration imports correctly. Without this patch, failed config imports can break the import process and cause form modes and widgets to malfunction. While applying patches is straightforward on standard composer-based sites, GovCMS SaaS doesn't make this easy.
Ivan's script solves this by manually patching the required file during installation. The patch itself is minimal, essentially a one- or two-line change that has been documented in an existing issue on The script applies this patch before running the installation, then reverts it at the end. This workaround became necessary because GovCMS SaaS containers don't ship with standard patching tools like patch or diff.
To use the script, developers download it with curl, make it executable with chmod, configure the parameters and run it. Ivan noted one current issue on Mac systems where a specific line (RM self) needs to be commented out, though this can be fixed in future versions.
Running the script in a Docker container
Ivan demonstrated the script using a fresh GovCMS SaaS installation with an empty themes directory. The example pulled in version 1.1 of Civic Theme and the main branch of the civic_theme_govcms module, with parameters set for a sub-theme called agency_gov_civic_theme.
When executed, the script downloads all required components and runs through several automated processes. It pulls in the GovCMS theme, executes provisioning commands and enters the CLI container to perform installation tasks. The script runs npm install and compiles all theme assets automatically, handling the node dependencies that would otherwise require manual intervention.
One of the script's advantages is that it runs node operations inside the Docker container rather than relying on local node installations. Ivan explained that he's encountered consistency issues when developers run different node versions locally. Running everything in the container ensures consistent behaviour across different development environments.
The installation process applies configuration changes, creates the sub-theme with the specified parameters and compiles all assets. After a few minutes (depending on internet speed and available Docker resources), the script completes and outputs confirmation that everything was installed successfully. The themes directory then contains two themes: the base Civic Theme and the custom sub-theme specified in the parameters.
Ivan logged into the newly configured site and created a test page to demonstrate that all widgets, paragraphs and banners were working correctly. The site was fully functional immediately after the script completed.
Automating Civic Theme updates
During the Q&A, attendees asked whether the script could be extended to handle theme updates, not just initial installation. Ivan acknowledged he hadn't considered updating yet, but agreed it would be technically feasible.
The discussion clarified that automated updates would apply to the base theme only, not custom sub-themes where changes could be overwritten. The update process would follow similar steps to the installation script, making it a realistic addition to the tool.
One attendee noted that on standard composer-based Drupal sites, updating Civic Theme is already straightforward with a single composer command. However, GovCMS SaaS environments have different requirements that make updates less simple. The group concluded that creating an update script would be possible and wouldn't require excessive work, though it remains on the backlog for future development.
Conclusion
Ivan Zugec's presentation demonstrated how a single automation script can remove the complexity from Civic Theme installation in GovCMS. The open-source tool is now available on GitHub for teams who want to deploy Civic Theme without manual configuration steps.
