title: Gitlab-CI environment variable from Python script to pipeline
body: <p>How I can get the gitlab-ci environment variable <code>VERSION</code> value from the python script - <code>get_version.py</code> for a gitlab-runners which will work on both OS windows and linux?
  I need some universal solution so that it works on both OS.</p>
  
  <p>Here is my <code>.gitlab-ci.yml</code> :</p>
  
  <pre><code>stages:
    - versioning
  
  variables:
    VERSION: ""
  
  versioning:
    stage: versioning
    script:
    - echo "[versioning] ..."
    - python ./ci-cd_scripts/get_version.py
    - echo $VERSION
  </code></pre>
  
  <p>Here is my <code>./ci-cd_scripts/get_version.py</code> :</p>
  
  <pre><code>import os
  
  refName = os.environ.get("CI_COMMIT_REF_NAME")
  piplineID = os.environ.get("CI_PIPELINE_ID")
  relVersion = refName + ".0." + piplineID
  
  version = relVersion.replace("rel.", "")
  print("current version is", version)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Z2XNc.jpg" rel="nofollow noreferrer">python output in pipeline log</a></p>