-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support global/project/step env even if buildkite trigger step is used #84
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,8 +104,28 @@ func generatePipeline(steps []interface{}, pipelineEnv map[string]string, projec | |
|
||
env, foundEnv := stepMap["env"].(map[interface{}]interface{}) | ||
_, foundBlockStep := stepMap["block"].(string) | ||
_, foundTriggerStep := stepMap["trigger"].(string) | ||
|
||
if !foundBlockStep { | ||
if foundTriggerStep { | ||
// Is there a build property | ||
build, foundBuild := stepMap["build"].(map[interface{}]interface{}) | ||
|
||
if (!foundBuild) { | ||
build = make(map[interface{}]interface{}) // TODO allow nesting | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please clarify this TODO? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apologies, I think it's errant. I'll remove. |
||
stepMap["build"] = build | ||
} | ||
|
||
buildEnv, foundBuildEnv := build["env"].(map[interface{}]interface{}) | ||
|
||
if (!foundBuildEnv) { | ||
buildEnv = make(map[interface{}]interface{}) | ||
build["env"] = buildEnv // env TODO add to build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please clarify this TODO as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto, errant comments. Apologies, will remove. |
||
} | ||
|
||
for envVarName, envVarValue := range pipelineEnv { | ||
buildEnv[envVarName] = envVarValue | ||
} | ||
} else if !foundBlockStep { | ||
if !foundEnv { | ||
env = make(map[interface{}]interface{}) | ||
stepMap["env"] = env | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be helpful to add a short comment describing the transformation that is being done in this block.