woodpecker-ci / woodpecker

Woodpecker is a simple yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
3.88k stars 345 forks source link

Per-agent environment variables option #3762

Closed silverwind closed 1 month ago

silverwind commented 1 month ago

Clear and concise description of the problem

A way to load common environment variables that can differ per agent is needed. Especially for things like https_proxy which can differ based on physical location of the agent. For example proxy1 in dc1 and proxy2 in dc2 can not realistically be configured from the workflow file because it does not know the location of the agent and shouldn't have to know either.

Suggested solution

Support a option WOODPECKER_AGENT_ENV_FILE that works like DRONE_RUNNER_ENV_FILE which can be mounted into the agent which would make the variables available to all pipelines.

Alternative

Maybe it could also be a per-agent config option in the UI.

Additional context

No response

Validations

zc-devs commented 1 month ago

https://github.com/woodpecker-ci/woodpecker/issues/3311

silverwind commented 1 month ago

Right, it's a duplicate, added my notes there.