Common Copier Config Submodule

This template uses a Git submodule (common-copier-config) that contains shared configuration used across multiple Copier templates. This ensures consistency and reduces duplication across VA Mobile Health templates.

For Template Users

Cloning the Template

When cloning this template repository, initialize the submodule:

# Clone with submodules
git clone --recurse-submodules https://coderepo.mobilehealth.va.gov/scm/ckm/ngss-devops-template.git

# Or if you already cloned without --recurse-submodules
git submodule update --init --recursive

Pulling Updates

When pulling updates that include submodule changes:

# Pull changes and update submodules
git pull
git submodule update --init --recursive

# Or in a single command
git pull --recurse-submodules

Checking Submodule Status

To see the current status of the submodule:

git submodule status

To see if there are newer commits available:

cd common-copier-config
git fetch
git log HEAD..origin/main --oneline
cd ..

For Template Maintainers

Updating the Submodule

If you’re maintaining this template and need to update the common configuration:

# Update submodule to latest main branch
git submodule update --remote --merge

Reviewing Changes

git diff --submodule

Committing the Update

git add common-copier-config
git commit -m "Update common-copier-config submodule"
git push

What’s in common-copier-config

The submodule contains:

  • common.yaml - Shared Copier questions (artifact_id, version, dtr_org, etc.)

  • context.py - Jinja extension for auto-detection of Maven and Git settings

  • Shared validators and filters

Troubleshooting

Submodule Not Initialized

If you see errors about missing files in common-copier-config/:

git submodule update --init --recursive

Submodule Out of Date

If copier reports missing variables or features:

git submodule update --remote --merge

Dirty Submodule Warning

If you see "Dirty template changes" warnings:

cd common-copier-config
git status
# Clean up any untracked files or commit changes
cd ..