1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-11-24 08:02:18 +02:00

Allowing for services with no environment defined.

This commit is contained in:
Joachim Hill-Grannec 2016-06-10 20:46:13 -07:00
parent fd2b4b71ba
commit 7e5a6ec9fb
2 changed files with 5 additions and 4 deletions

View File

@ -210,9 +210,6 @@ func (a *Agent) exec(spec *yaml.Config, payload *queue.Work, cancel <-chan bool)
}
// updates the build status passed into each container. I realize this is
// a bit out of place and will work to resolve.
if pipeline.Head().Environment == nil {
pipeline.Head().Environment = make(map[string]string)
}
pipeline.Head().Environment["DRONE_BUILD_STATUS"] = status
if !pipeline.Head().Constraints.Match(

View File

@ -16,7 +16,11 @@ var (
// Environ transforms the steps in the Yaml pipeline to include runtime
// environment variables.
func Environ(c *yaml.Config, envs map[string]string) error {
for _, p := range c.Pipeline {
var images []*yaml.Container
images = append(images, c.Pipeline...)
images = append(images, c.Services...)
for _, p := range images {
if p.Environment == nil {
p.Environment = map[string]string{}
}