mirror of
https://github.com/rancher/os.git
synced 2025-06-27 15:26:50 +00:00
Godep updates
This commit is contained in:
parent
c955c34e3b
commit
783c4639c9
8
Godeps/Godeps.json
generated
8
Godeps/Godeps.json
generated
@ -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",
|
||||
|
19
Godeps/_workspace/src/github.com/rancherio/rancher-compose/project/project.go
generated
vendored
19
Godeps/_workspace/src/github.com/rancherio/rancher-compose/project/project.go
generated
vendored
@ -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 {
|
||||
|
3
Godeps/_workspace/src/github.com/rancherio/rancher-compose/project/types.go
generated
vendored
3
Godeps/_workspace/src/github.com/rancherio/rancher-compose/project/types.go
generated
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user