Hi I am deploying a jar (spring boot) in a container onto GKE using gitlab autodevops
I can get my application to go through the pipeline fine based on the tutorials.
How do I configure different db details based on the environment (Staging or Production). I dont use a gitlab-ci.yml file as per tutorials.
Think I found my answer. Will try it out and post here for anyone else looking.
Application secret variables
Introduced in GitLab 11.7.
Some applications need to define secret variables that are accessible by the deployed application. Auto DevOps detects variables where the key starts with
K8S_SECRET_ and make these prefixed variables available to the deployed application, as environment variables.
To configure your application variables:
- Go to your project’s Settings > CI/CD , then expand the section called Variables .
- Create a CI Variable, ensuring the key is prefixed with
K8S_SECRET_ . For example, you can create a variable with key
- Run an Auto Devops pipeline either by manually creating a new pipeline or by pushing a code change to GitLab.