1
0
mirror of https://github.com/rancher/os.git synced 2025-06-27 15:26:50 +00:00

Godep updates

This commit is contained in:
Darren Shepherd 2015-04-15 23:00:16 -07:00
parent c955c34e3b
commit 783c4639c9
3 changed files with 13 additions and 17 deletions

8
Godeps/Godeps.json generated
View File

@ -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",

View File

@ -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 {

View File

@ -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