I`m trying to migrate our application code from Jenkins to Gitlab. Here, I would like to play around variables specific to branch. For ex: 1) Master branch code will be deployed to production 2) Other branch code is eligible to deploy in Non-Prod environments.
Where in Jenkins, the variables are set according to the different pipeline they have created. How can I do the same in by using the gitlab variables features.
I would need something like this.
AWS_KEY variable for master branch should be set as "XXX", where in AWS_KEY variable for non-master branch should be set as "YYY". I would like to configure the same in gitlab UI itself (so that I can mask the values in the GITLAB).
variables:
aws_credentials: $AWS_KEY
The above code snippet will be used in the gitlab-ci.yml file of my repository. AWS_KEY value should change according to the branch name.