Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,761
    • Issues 44,761
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,328
    • Merge requests 1,328
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #219065
Closed
Open
Issue created May 25, 2020 by Paul Mesnilgrente@paul-mesnilgrente

Variable can be used on `include.ref` in `.gitlab-ci.yml`

Problem to solve

As a dev ops engineer, I want to be able to use a variable in include.ref in my .gitlab-ci.yml, so I can update a CI variable in the group and I don't have to update the .gitlab-ci.yml of every projects

Intended users

Developer, DevOps engineer.

User experience goal

As a dev ops engineer, I would like to maintain multiple projects pipelines with a template. The problem comes when I want to update the template. I would like pipelines to reference the template from a tag:

include:
  project: 'my-group/ci-pipelines'
  ref: v1
  file: 'templates/main.yml'

Then, if I create a new tag to fix a bug in the pipeline, I have to go through every single projects to update that ref to v2 which is long and cumbersome.

Proposal

If the .gitlab-ci.yml was allowing to reference a variable:

include:
  project: 'my-group/ci-pipelines'
  ref: $PIPELINE_TEMPLATE_REF
  file: 'templates/main.yml'

Then I would only have to update this variable in the group CI variables.

References

https://docs.gitlab.com/ee/development/cicd/#ci-architecture-overview

Edited Jul 15, 2021 by Tan Le
Assignee
Assign to
Time tracking