I am trying to update a Gitlab environment variable from a python scripts :
In the gitlab-ci.yml
gitlab_job:
stage: gitlab_stage
script:
- python set_myvar.py
- echo $MYVAR
In the set_myvar.py
import os
os.environ["MYVAR"] = my_value
I don't need the variable to persist. I just need it to be programmaticaly updated (from python).
So far, it doesnt do anything.
export MYVAR=$(python -c 'print("NewValue")')