How to add instance variable available to all projects and groups in a GitLab instance and to use in .gitlab-ci.yml for pipeline execution

During building of git pipeline you may need to add some values which you dont want to expose in the pipeline , or some constants you wish, or some value you may need to change later . In that situation its better to have a variable outside the code. You can create as follows.

  1. Go to you gitlab projects path 
  2. In the last there will be settings 
  3. In Settings => CI/CD
  4. In CI/CD => Variables
  5. You can enter values there Key [ The variable that you wish to accept from gitlab-cy.yml ] and its value
  6. You can directly access those value in the gitlab-cy.yml , by prefixing “$”

example

key : $PROD_ENV_ADDRESS 

value freshers.in/tags/python

Once you have CI/CD open go to the variables

Reference docs

Get more post on Python, PySpark

Author: user

Leave a Reply