Using ENVIRONMENT VARIABLE at conditional steps.
M
Mario Wolff
We also request this feature. We discovered changes to our K8S clusters that causes downtimes. Whenever such a change is required, we build a mirror cluster with the change, deploy to both clusters, do integration tests with the new setting and turn the DNS to mirror. Then we stop deployment to the first cluster and remove it. For the next critical change the process starts over.Currently we change the config in all projects, but thats gets harder and harder with every new project.
M
Matthew Morrissette vance
I need this because we use forked repositories to manage access control to sensitive secrets as we're a BitBucket organization and can't use context security and we need the ability to vary which build steps run based on the fork (which could be set in environment variables).
N
Nathan Dintenfass
I'm going to mark this as Not Planned because we don't have a way to do it with Environment Variables, but do know that this kind of dynamism is very much on our mind. We plan to introduce the variables in config I described, and we're also looking at ways to more dynamically set the environment at runtime (for instance, having the ability to run some kind of setup job that would let you dynamically set the config based on the state of your code).
A
Artur Gontijo
I have a repo that builds 6 Dockerfiles.When I update one of them I'd like to build only this one, without touching the
config.yml
.So I thought that setting all 5 dockerfiles to "CONDITION_BUILD_1, _2, ..., _5 = false" and leaving just "CONDITION_BUILD_6 = true" on CircleCI dashboard would be great.With this I'd avoid waiting to all the untouched Dockerfiles be built.N
Nathan Dintenfass
We can't use Env Vars in this context because those are resolved at runtime, whereas the
when
clause is resolved during configuration processing. We do plan to introduce pipeline-level variables in config that would you set a single variable either inside of config or when triggering your pipeline via the API, which would solve for some cases of wanting to do this. Can you elaborate a bit on what the scenarios are that would cause you do change this value?S
Stephen Colebourne
Nathan Dintenfass It is very disappointing to see claims of "can't do this". It is software - of course you can do this, you are choosing not to. The implementation is simply a runtime wrapper around the remaining steps with an if clause checking the variable. The whole "dynamic configuration" approach is an absurdly overengineered solution for this basic requirement. Without this I have to lose all the structure that CircleCI offers and move everything to bash - it completely wrecks build scripts.