Add CI_ENVIRONMENT Predefined Environment Variable

Description

Knowing which environment is useful for deploy jobs in pipelines that use templates. Currently I need to set the CI_ENVIRONMENT variable on each job using a format like this:

deploy to production:
  <<: *deploy_definition
  environment: production
  variables:
    CI_ENVIRONMENT: production
  only:
    - master@group/repo
    - tags@group/repo

This is because I have steps in the deploy_definition that need to know which environment is being deployed

Proposal

Include CI_ENVIRONMENT as a predefined environment variable by default so that it does not need to be set in the config

Edited Aug 20, 2020 by Jackie Porter
Assignee Loading
Time tracking Loading