Skip to content
GitLab Next
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab FOSS GitLab FOSS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLab FOSSGitLab FOSS
  • Issues
  • #24207
Closed
Open
Created Nov 05, 2016 by Daniel Dent@DanielDent

allow variable substitution in CI tag names

Description

I wrote the following .gitlab-ci.yml:

deploy:
  stage: deploy
  environment:
    name: $CI_BUILD_REF_NAME
  only:
    - /^env-.*$/
  tags:
    - deploy
    - $CI_BUILD_REF_NAME

I was expecting a deploy to run on a runner with a tag name the same as the name of my branch (to have the proper environment's deployment variables securely injected).

Instead, I got a hung build where it was looking for a runner with the tag $CI_BUILD_REF_NAME.

Proposal

When evaluating a .gitlab-ci.yml file to schedule a job, first perform variable substitution prior to the logic used for selecting a runner.

Additionally consider implementing regex-style variable manipulation as proposed in #24044 (closed). These two improvements combined would be especially powerful.

Assignee
Assign to
Time tracking