templating engine for CICD variables in gitlab-ce
Problem to solve
as a devops engineer, I want to use a kind of templating engine to use gitlab CICD variables with gitlab-ci.yml to fill a custom template file (in my case a PHP Laravel (.env) environment file ). Now, I use the sed command in the script part of gitlab-ci.yml to for example search/replace the word database-password in the .env file for the value of the gitlab variable. This works but a nice templating engine would be nice if there is a kind of feature to do this.
Intended users
Developers and devops engineers will be the intended users.
User experience goal
The user will be able to refer to a template file (for example in the root of the git repository). Maybe the template filetype can be (for example )Jinja2 (like Ansible uses)or something else. This eliminates the use of sed (search/replace).
Proposal
as a devops engineer, in the gitlab-ci.yml file I want to be able to refer to a template file in which gitlab variables can be used. The result needs to be a file which can be used directly without any more modifications at the destination server where the application will be deployed. In my case, I use "kubectl apply -f secrets.yml" to deploy a PHP Laravel .env file as a secret in Kubernetes.