Multiple Template Subfolders
USE CASE: Multiple Template Subfolders
Section titled “USE CASE: Multiple Template Subfolders”This guide explains how to use SKA when a remote repository hosts multiple templates in subfolders (for example, one repo acting as a catalog of templates).
When to use this
Section titled “When to use this”- Your organization keeps many templates in a single repository, each under its own folder.
- You want to scaffold from a specific subfolder path and optionally pin a branch or tag.
Blueprint URL format for subfolders
Section titled “Blueprint URL format for subfolders”You can reference a subfolder inside a remote Git repository by including the path after the repository name and before the optional ref:
[!NOTE]
- The ref after the @ can be a branch (e.g., @main), a tag (e.g., @v1.2.3), or omitted to use the default branch.
- Both URL forms are supported. Use the one you prefer.
Example repository layout
Section titled “Example repository layout”Suppose your template catalog looks like this:
templates-repo/templates/ service-rest/ service-grpc/ library-utility/ common/ fragments/Each folder under templates/ is a separate blueprint you can target.
Create from a subfolder template
Section titled “Create from a subfolder template”Scaffold a new project by pointing —blueprint to the subfolder:
- Using an HTTPS URL:
Terminal window ska create \--blueprint https://github.com/your-org/templates-repo/templates/service-rest@v1.2.0 \--output ./my-rest-service
What happens:
- SKA downloads only what it needs from the repo.
- It loads the template from the specified subfolder.
- If the template defines inputs, SKA will show the interactive form (unless you use —non-interactive).
Pinning and updating
Section titled “Pinning and updating”- Pin a known-good template version with a tag: @v1.2.0
- Use a branch for fast iteration: @main or @develop
- Omit @ to use the repository’s default branch
After creation, your project contains a .ska-config/ folder that stores the upstream reference. To bring in updates from the same upstream path and ref: