Skip to content

[WIP] Expand variables with values in CI config

Ivan Bakalov requested to merge DXTimer/gitlab-ce:expand_vars_ci_config into master

What does this MR do?

Adds the ability to define more complex variables by means of variable composites.

this-job-name-123:
  except:
    variables:
    - $CI_COMMIT_MESSAGE =~ /Skip $CI_JOB_NAME/i
    - $STRING_VAR = Current job name is ${CI_JOB_NAME}
  script:
  - echo The job runs unless the commit message contains "Skip this-job-name-123"

Are there points in the code the reviewer needs to double check?

  • Replication of code between the Pattern and String Lexeme
  • What is the desired behavior in case of a referenced variable not being defined (Current behavior is that the variable reference is removed from the original regexp or string)

Why was this MR needed?

  • More flexibility should be added for the definitions of variables in CI jobs.
  • This change was requested in #49534 (moved)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

@grzesiek

Edited by Ivan Bakalov

Merge request reports