Provide global environment variables for pipeline substitution (#968)

* make global environment variables available for pipeline substitution

* lint fixes

* global env support in cli exec; procBuilder tests

* drop GLOBAL_ prefix

* docs

* documentation typo

* Update docs/docs/20-usage/50-environment.md

as suggested by anbraten

Co-authored-by: Anbraten <anton@ju60.de>

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
Arno Hautala
2022-07-30 02:06:03 -04:00
committed by GitHub
parent 6351684070
commit d5e31dc187
4 changed files with 97 additions and 2 deletions

View File

@@ -110,6 +110,11 @@ func execWithAxis(c *cli.Context, file, repoPath string, axis matrix.Axis) error
for _, env := range c.StringSlice("env") {
envs := strings.SplitN(env, "=", 2)
droneEnv[envs[0]] = envs[1]
if _, exists := environ[envs[0]]; exists {
// don't override existing values
continue
}
environ[envs[0]] = envs[1]
}
tmpl, err := envsubst.ParseFile(file)