Closed wilsonwang371 closed 6 months ago
Thank you for your question.
I think there are two ways to use it here:
kcl main.k dev.k
or kcl main.k prod.k
kcl main.k -D env=prod
or kcl main.k -D env=dev
However, my personal suggestion is to choose the former as the best practice for tools such as Helm and Kustomize in GitOps.
General Question
What is the best approach to use a runtime variable to decide which file in a directory to include?
For example, I have
dev.k
prod.k
in a directory. I want to include one of them when run kcl build. What is the best approach to do this? Thedev.k
is for dev environment andprod.k
is for production environment.