Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 55k
    • Issues 55k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1.6k
    • Merge requests 1.6k
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
    • Model experiments
  • Monitor
    • Monitor
    • 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