Skip to content
GitLab Next
  • Menu
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,045
    • Issues 44,045
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,311
    • Merge requests 1,311
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & 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
  • #25514
Closed
Open
Created Nov 30, 2018 by Jared@szechyjs

User-defined CI variables available to docker build with Auto DevOps

Problem to solve

CI environment variables are not made available to docker build stage when using Auto DevOps.

Intended users

developers

Further details

Passing user defined CI variables to a docker build stage is a very common scenario that should be supported by Auto DevOps.

Proposal

Add a feature to CI/Runner which exposes all of the CI variables in another variable so we know what to pass through to the build container.

Previous proposal Provide a mechanism to indicate a CI variable should be made available to auto-build, this could be either:

A new variable that contains a list of the variable names to be passed to build stage

image

Permissions and Security

Documentation

Testing

What does success look like, and how can we measure that?

Measure usage of Auto DevOps variables

Links / references

Original issue content

Summary

Pass all environment variables to build step in default Auto DevOps template. During the build phase of our project it requires api keys that are set using CI environment variables. However, when the build is done (in this case using herokuish) the environment variables are not available.

Steps to reproduce

  • Define CI variable in project settings
  • Trigger auto devops pipeline

What is the current bug behavior?

Environment variables defined in CI variables settings are not available during the build phase of Auto DevOps

What is the expected correct behavior?

User defined CI variables should be available during the build phase of Auto DevOps

Possible fixes

From looking at the default Auto DevOps template it seems that there is a small subset of environment variables that are passed to the docker build step. A fix would be passing in all of the CI environment variables.

https://gitlab.com/gitlab-org/cluster-integration/auto-build-image/blob/master/src/build.sh#L26

Edited Sep 16, 2019 by Daniel Gruesso
Assignee
Assign to
Time tracking