HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

How to set a Circle CI environment variable for a project?

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
circleenvironmentprojectforhowvariableset

Problem

I've set the environment variable with a "context" (I have no idea if thats the right place - it's really confusing!)

None the less, it's now doing a build - and I don't see the environment variables set (I'm using the SSH build to inspect the vars with getenv).

Why is it not being picked up? Am I meant to set an environment variable by some other means rather than a "context"?

Solution

https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project

Seems "contexts" can be used but must then also be set to "reference" the context in the build yaml config file.

Instead to set a environment variable for a project:
Jobs > Cog / gear icon of a project > Build settings > Environment variable

Context

StackExchange DevOps Q#9351, answer score: 1

Revisions (0)

No revisions yet.