The first one seems better for us, as it uses go templates. But using any of them still has the same basic problem: the source repo is full of template placeholders, so you can't work with the repo directly, you can't build or validate it.
2 solutions come to my mind:
Just use plain [A-z] placeholders, like REGISTRY_HOST instead of [[REGISTRY_HOST]]. Replace with sed as it is now. Repo might get buildable this way, although some validation for placeholder values might fail (i.e. a field with a placeholder must validate as a number, while it is REPLICA_COUNT in the repo.
Use one of the templating engines (boilerplate) and to build and validate changes to the template repo, the CI/CD first runs the templating engine, then validates the templated output.
I'm leaning towards 2.
Note: we don't focus that much towards CI/CD part of the build process, we only want it to be reasonable.
I checked two very similar projects for scaffolding and generating new repos from templates:
The first one seems better for us, as it uses go templates. But using any of them still has the same basic problem: the source repo is full of template placeholders, so you can't work with the repo directly, you can't build or validate it.
2 solutions come to my mind:
REGISTRY_HOST
instead of[[REGISTRY_HOST]]
. Replace withsed
as it is now. Repo might get buildable this way, although some validation for placeholder values might fail (i.e. a field with a placeholder must validate as a number, while it isREPLICA_COUNT
in the repo.boilerplate
) and to build and validate changes to the template repo, the CI/CD first runs the templating engine, then validates the templated output.I'm leaning towards 2.
Note: we don't focus that much towards CI/CD part of the build process, we only want it to be reasonable.