Copier Templates
Copier is a template rendering tool that helps scaffold and maintain project configurations. NGSS provides two main Copier templates:
-
ngss-devops-template - Generates Kubernetes manifests, Skaffold configuration, and kustomize overlays
-
ngss-backstage-template - Generates Backstage catalog entries and documentation structure
Why Copier?
-
Auto-detection - Automatically detects project settings from
pom.xmland existing configs -
Consistent - Ensures all services follow the same conventions
-
Interactive Setup - Answer configuration questions interactively
-
Answers Storage - Project variables are saved in
.copier-answers/*.yamlfiles -
Smart Updates - Run an update goal (e.g.,
copier-update) to merge new template changes without losing customizations -
Conflict Resolution - Copier intelligently merges updates while preserving your modifications
| Never edit the Copier answers files directly as these are managed by Copier itself. See Copier documentation. |
Getting Started
-
Install Copier via pipx or Docker
-
Choose a template guide:
-
DevOps Template - Kubernetes, Skaffold, Kustomize
-
Backstage Template - Catalog entries, documentation
-
Quick Reference
# Copier CLI - Initial setup
copier copy https://coderepo.mobilehealth.va.gov/scm/ckm/ngss-devops-template.git .
# Maven equivalent (initializes all standard templates)
mvn filegen:copier-init
# Copier CLI - Update existing project
copier update -a .copier-answers/devops.yaml
# Maven equivalent
mvn filegen:copier-update -Dcopier.template=devops
# Copier CLI - Check for updates (stable releases)
copier check-update -a .copier-answers/devops.yaml .
# Copier CLI - Check for updates (including pre-releases/RC)
copier check-update -a .copier-answers/devops.yaml . --prereleases
# Copier CLI - Re-prompt specific questions
copier update --ask version -a .copier-answers/devops.yaml --skip-answered
To test pre-release template versions (RC, alpha, beta), add --prereleases to CLI commands or -Dcopier.prereleases to Maven goals. See Testing Pre-Release Versions for details.
|
The filegen Maven plugin provides similar functionality with goals like filegen:copier-init and filegen:copier-update. See Filegen 6 Migration Guide for details.
|
See Installation Guide for setup instructions including trust configuration and troubleshooting.