Since my environments are in different aws accounts, I can provide the different values to them.
Second, I can set permission that developers can only access dev context, support team can only access prod context.
But I don’t get the same feature in Gitlab CI.
In one of gitlab document, it mentions Group, but after I check, it doesn’t work as expect at all.
Contexts and variables
CircleCI provides Contexts to securely pass environment variables across project pipelines. In GitLab, a Group can be created to assemble related projects together. At the group level, CI/CD variables can be stored outside the individual projects, and securely passed into pipelines across multiple projects.
Are there any way I can do that in Gitlab CI?
Sample usage of context in Circli CI for your reference
There is a variety of ways to do this. Sometimes you might want parallel:matrix but much of the time you will probably want to just use inheritance or just YAML anchors.
thanks, went through the feature of inheritance, but it can’t help a lot the inheritance is for some default variable and values, but mine are some screts, or credentials, I don’t want to set as plain text.
I’m not sure I follow you. You can add CI variables from the Settings → CI/CD section of your project. Just mark the variables that are secret as Masked and they won’t appear in pipeline logs.
Just add the variables to your project, set them as Masked, you can restrict them to different environments if you have separate variables for staging and production. Then in your .gitlab-ci.yml file you just refer to the variable by name, like any other Bash variable: e.g. $AWS_ACCESS_KEY_ID, etc.
The URL only matters if you are deploying to an environment which is accessible via a URL (for example, deploying a website). If your deployment does something else (e.g. deploys a new package to a package registry) then it doesn’t really matter. If you go to your environments page, you can access a deployment via its URL (I think), so it’s a convenience for things like that, but otherwise not important.
It’s my first time to create the environment, the url is a must-set value, without put something in it, it doesn’t allow me to save the setting, I have to read and google a lot, takes me 2 hours to figure it out, any values can be accepted
then, gitlab ci document and other pipeline I googled from public, always follow with a url when use environment in its pipeline file.