Remote Templates
Boilerplate supports fetching templates from remote sources using HashiCorp go-getter URLs. This lets you share templates across teams and organizations.
Git URLs
Section titled “Git URLs”boilerplate \ --template-url "git@github.com:myorg/templates.git//go-service?ref=v1.0.0" \ --output-folder ./outputboilerplate \ --template-url "github.com/myorg/templates//go-service?ref=main" \ --output-folder ./outputURL Format
Section titled “URL Format”<source>//<subdirectory>?ref=<branch-or-tag>| Part | Description |
|---|---|
source | Git repository URL (SSH or HTTPS) |
// | Separator between repo URL and subdirectory |
subdirectory | Path within the repository to the template |
?ref= | Git ref (branch, tag, or commit SHA) |
Examples
Section titled “Examples”# Specific taggit@github.com:myorg/templates.git//microservice?ref=v2.1.0
# Branchgit@github.com:myorg/templates.git//microservice?ref=main
# Commit SHAgit@github.com:myorg/templates.git//microservice?ref=abc123
# Root of repositorygit@github.com:myorg/single-template.gitSupported Sources
Section titled “Supported Sources”Go-getter supports many sources beyond Git:
- Git —
git::https://...orgit@... - HTTP/HTTPS — Direct file downloads
- S3 —
s3::https://s3.amazonaws.com/bucket/path - GCS —
gcs::https://www.googleapis.com/storage/v1/bucket/path - Local files — Absolute or relative paths
Dependencies with Remote URLs
Section titled “Dependencies with Remote URLs”Dependencies can also reference remote templates:
dependencies: - name: shared-lib template-url: "git@github.com:myorg/templates.git//shared-lib?ref=v1.0.0" output-folder: ./lib