I’ve been searching around on how to pass variables to a pipeline that uses the plugins/docker.
In fact, I would like to set the registry setting from a variable that could be reused in other pipelines.
Is there a way to do so in the
.drone.yml file ?
Here is what a tried but the settings does not take the variables… no luck to make it work.
See the below repo or registry settings that I try to inflate with variables.
- name: build:master
Thanks in advance for any advice or help!
One way to do it might be to use secrets however IMO it’s a shame that you can’t have public secrets - ie configuration that works like secrets but you can see the values
by which I mean bits of information configured and used like drone secrets are but visible rather than kept secret
The reason your example does not work is two fold. First is that parameters are substituted before the yaml is parsed as noted in the documentation.
Parameter expressions are evaluated
before the yaml is parsed. If you do not want the system to evaluate an expression it must be escaped.
And second, you can only substitute repository and build variables:
Please see the environment
Reference for a list of parameters that can be used for substitution. Only parameters in this list can be used for substitution.
If you want to dynamically build yaml files you might consider enabling jsonnet  or installing the starlark scripting extension .
One way to do it might be to use secrets
This will not work with secrets because secrets are not interpolated.
That’s very clear. Thanks
I’ll probably give a go to jsonnet later.
Thx for the quick responses!