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
  • #29407
Closed
Open
Issue created Jun 11, 2019 by Philip Schiffer@philip.schiffer

Backend: Disable expansion of file type variables when referenced in gitlab-ci variables section

Summary

When using file variables in the "variables" section of a job in .gitlab-ci.yml the contents are being written to the new variable.

Steps to reproduce

The following gitlab-ci.yml

.deployment:
   image: alpine:latest
   script:
      - kubectl config set-cluster ${KUBE_CLUSTER} --server=${KUBE_SERVER} --certificate-authority="${KUBE_CA}"

"Deploy to stage":
   extends: .deployment
   stage: deploy:stage
   when: manual
   variables:
      KUBE_CA: $KUBE_CA_STAGE

"Deploy to prod":
   extends: .deployment
   stage: deploy:prod
   when: manual
   variables:
      KUBE_CA: $KUBE_CA_PROD

The variable KUBE_CA_PROD / KUBE_CA_STAGE are file variables in Gitlab. When using the variable KUBE_CA the contents are no longer a path to a file but the content of the file.

What is the current bug behavior?

Contents of file variables are written to variables

What is the expected correct behavior?

Path of file variable is used as variable

Results of GitLab environment info

Expand for output related to GitLab environment info

System information System: Ubuntu 18.04 Proxy: no Current User: git Using RVM: no Ruby Version: 2.5.3p105 Gem Version: 2.7.9 Bundler Version:1.17.3 Rake Version: 12.3.2 Redis Version: 3.2.12 Git Version: 2.21.0 Sidekiq Version:5.2.7 Go Version: unknown

GitLab information Version: 11.11.2-ee Revision: cfdecb7c5de Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 9.6.11 URL: https://gitlab.XXXXX.com HTTP Clone URL: https://gitlab.XXXXX.com/some-group/some-project.git SSH Clone URL: git@gitlab.XXXXX.com:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: yes Using Omniauth: yes Omniauth Providers:

GitLab Shell Version: 9.1.0 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check
not relevant

Proposal

Step Status
1. GitLab: Stop expanding file variables when sending to Runner #365859 (closed)
2. Runner: Refactor the creation of the job temporary file path gitlab-runner#29128
3. Fix file variables in Runner 👈 You are here

Technical

#29407 (comment 935276800)

Note

TODO: Update the docs in !75477 (merged) when this issue is closed.

Edited Jun 21, 2022 by Mark Nuzzo
Assignee
Assign to
Time tracking