Closed wxiaoguang closed 2 years ago
looks like an issue of urfave/cli - but I'll have a look at it
How do you think about using this syntax?
WOODPECKER_ENV__X=y
WOODPECKER_ENV__foo=bar
well I would fix it upstream ... (It's indeed a bug of that lib)
If I propose a PR about the feature of WOODPECKER_ENV__key
, is it acceptable?
In many cases, WOODPECKER_ENVIRONMENT=k:v,foo:bar
is more difficult to use, for example, if there are many environment variables, if the key/value are long, if there are commas or colons in values, etc. Using WOODPECKER_ENV__key=value
would make it easier and more clear for users.
well it would definetly add extra code ... and I dont see much upside beside more redable docker-compose configs ...
what do you want to store in env vars, as you argue about to long key/value ?!? you can store a lot in it...
@wxiaoguang the thing is, in my opinion if you run out of space for the information you like to pass on to, via environment-vars, you probably try to solve the problem the wrong way ...
well it would definetly add extra code ...
Hmm ... just a few lines, a for loop.
and I dont see much upside beside more redable docker-compose configs ... what do you want to store in env vars, as you argue about to long key/value ?!? you can store a lot in it...
Now I use WOODPECKER_ENVIRONMENT=DOCKER_HOST:unix:///data-dind/dockerd/docker.sock,DOCKER_CONFIG:/data-dind/docker-config,....
to pass common variables to all agents. I think here is the correct place to write these variables, instead of writing them in every agent docker-compose file.
And I can not use commas in the variable value, it breaks the syntax ......
And yes, the feature WOODPECKER_ENV__key
is not a must, it could always be rewritten into separate agent docker-compose files.
-> #781
@wxiaoguang as opt in for v1.0.0 we can argue about, If it indeed is only a few lines of code ... I will have my thoughts about this again once at least a code draft exists we can talk about - for now as a bugfix this is not wat we should talk about ... beside I just found the dumb mistake made already ...
tldr: it would be nice if new idears would be discusted in new issues, of course they can&should be referenced to where they originated from ....
No problem. Thank you very much.
ps: should the code output an error log if len(kvPair) != 2
? it could help users to debug their mistakes more easliy.
Component
server
Describe the bug
Bug
The expected WOODPECKER_ENVIRONMENT is:
But if we write:
Then the server panics.
Syntax
The syntax
WOODPECKER_ENVIRONMENT=k:v,foo:bar
is very difficult to read or write, especially when there are a lot of variables, or some variables contain comma or colon.I think the new syntax (use 2 underlines) can be better:
Log
System Info
Additional context
No response
Validations