diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 9ba1627e..f368d5b8 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -221,13 +221,13 @@ }, { "ImportPath": "github.com/rancherio/rancher-compose/docker", - "Comment": "0.1.0-10-g6c6a2e3", - "Rev": "6c6a2e3ad4023fafc7509787994dc51774006f26" + "Comment": "0.1.0-12-g8fecf18", + "Rev": "8fecf186bdab6b14c9f625f9499f959fd8590482" }, { "ImportPath": "github.com/rancherio/rancher-compose/project", - "Comment": "0.1.0-10-g6c6a2e3", - "Rev": "6c6a2e3ad4023fafc7509787994dc51774006f26" + "Comment": "0.1.0-12-g8fecf18", + "Rev": "8fecf186bdab6b14c9f625f9499f959fd8590482" }, { "ImportPath": "github.com/ryanuber/go-glob", diff --git a/Godeps/_workspace/src/github.com/rancherio/rancher-compose/project/project.go b/Godeps/_workspace/src/github.com/rancherio/rancher-compose/project/project.go index 25ab41a4..00abc3b8 100644 --- a/Godeps/_workspace/src/github.com/rancherio/rancher-compose/project/project.go +++ b/Godeps/_workspace/src/github.com/rancherio/rancher-compose/project/project.go @@ -3,7 +3,6 @@ package project import ( "bytes" "errors" - "fmt" "strings" "sync" @@ -44,9 +43,8 @@ func (p *Project) createService(name string, config ServiceConfig) (Service, err continue } - value := p.EnvironmentLookup.Lookup(env, name, &config) - if value != "" { - parsedEnv = append(parsedEnv, fmt.Sprintf("%s=%s", env, value)) + for _, value := range p.EnvironmentLookup.Lookup(env, name, &config) { + parsedEnv = append(parsedEnv, value) } } @@ -65,6 +63,7 @@ func (p *Project) AddConfig(name string, config *ServiceConfig) error { p.Notify(SERVICE_ADD, service, nil) + p.reload = append(p.reload, name) p.configs[name] = config p.Services[name] = service @@ -91,22 +90,18 @@ func (p *Project) Load(bytes []byte) error { func (p *Project) Up() error { wrappers := make(map[string]*ServiceWrapper) - for name, _ := range p.Services { - wrappers[name] = NewServiceWrapper(name, p) - } - p.Notify(PROJECT_UP_START, nil, nil) return p.startAll(wrappers) } func (p *Project) startAll(wrappers map[string]*ServiceWrapper) error { - for name, _ := range p.Services { - if _, ok := wrappers[name]; !ok { - wrappers[name] = NewServiceWrapper(name, p) - } + for _, name := range p.reload { + wrappers[name] = NewServiceWrapper(name, p) } + p.reload = []string{} + restart := false for _, wrapper := range wrappers { diff --git a/Godeps/_workspace/src/github.com/rancherio/rancher-compose/project/types.go b/Godeps/_workspace/src/github.com/rancherio/rancher-compose/project/types.go index 811a60ad..0b469c16 100644 --- a/Godeps/_workspace/src/github.com/rancherio/rancher-compose/project/types.go +++ b/Godeps/_workspace/src/github.com/rancherio/rancher-compose/project/types.go @@ -58,13 +58,14 @@ type ServiceConfig struct { } type EnvironmentLookup interface { - Lookup(key, serviceName string, config *ServiceConfig) string + Lookup(key, serviceName string, config *ServiceConfig) []string } type Project struct { EnvironmentLookup EnvironmentLookup Name string configs map[string]*ServiceConfig + reload []string Services map[string]Service file string content []byte