So I am writing a Deployment and Teardown Job and those use Environment Variables from the Gitlab variable store. Now the Teardown Job might be started much later than the Deployment, so the question is: Can I assume that the Environment Variables between the Deployment and Teardown will stay the same? Would a change to the Variable store between Deployment And Teardown have an effect on the Job? Or are Variables “frozen” when the Pipeline is created?
I am thinking this is not the case since you can rerun pipelines. (Presumably with different environment variables)
So if that is not the case I probably have to cache the environment variables somehow - maybe in an artifact. Although I am currently planning to use environment variables for tags - since that allows for an easy change from one server to the next by simply changing the global tag environment variable and all the project would use the runner on the new server during the next run. But that introduces this consistency problem since I probably can not use artifacts to define tags…
EDIT: it appears I am not allowed to use environment variables for tags (Where variables can be used | GitLab)