mirror of
https://github.com/rancher/os.git
synced 2025-06-29 00:06:49 +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",
|
"ImportPath": "github.com/rancherio/rancher-compose/docker",
|
||||||
"Comment": "0.1.0-10-g6c6a2e3",
|
"Comment": "0.1.0-12-g8fecf18",
|
||||||
"Rev": "6c6a2e3ad4023fafc7509787994dc51774006f26"
|
"Rev": "8fecf186bdab6b14c9f625f9499f959fd8590482"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/rancherio/rancher-compose/project",
|
"ImportPath": "github.com/rancherio/rancher-compose/project",
|
||||||
"Comment": "0.1.0-10-g6c6a2e3",
|
"Comment": "0.1.0-12-g8fecf18",
|
||||||
"Rev": "6c6a2e3ad4023fafc7509787994dc51774006f26"
|
"Rev": "8fecf186bdab6b14c9f625f9499f959fd8590482"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/ryanuber/go-glob",
|
"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 (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
@ -44,9 +43,8 @@ func (p *Project) createService(name string, config ServiceConfig) (Service, err
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
value := p.EnvironmentLookup.Lookup(env, name, &config)
|
for _, value := range p.EnvironmentLookup.Lookup(env, name, &config) {
|
||||||
if value != "" {
|
parsedEnv = append(parsedEnv, value)
|
||||||
parsedEnv = append(parsedEnv, fmt.Sprintf("%s=%s", env, value))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,6 +63,7 @@ func (p *Project) AddConfig(name string, config *ServiceConfig) error {
|
|||||||
|
|
||||||
p.Notify(SERVICE_ADD, service, nil)
|
p.Notify(SERVICE_ADD, service, nil)
|
||||||
|
|
||||||
|
p.reload = append(p.reload, name)
|
||||||
p.configs[name] = config
|
p.configs[name] = config
|
||||||
p.Services[name] = service
|
p.Services[name] = service
|
||||||
|
|
||||||
@ -91,22 +90,18 @@ func (p *Project) Load(bytes []byte) error {
|
|||||||
func (p *Project) Up() error {
|
func (p *Project) Up() error {
|
||||||
wrappers := make(map[string]*ServiceWrapper)
|
wrappers := make(map[string]*ServiceWrapper)
|
||||||
|
|
||||||
for name, _ := range p.Services {
|
|
||||||
wrappers[name] = NewServiceWrapper(name, p)
|
|
||||||
}
|
|
||||||
|
|
||||||
p.Notify(PROJECT_UP_START, nil, nil)
|
p.Notify(PROJECT_UP_START, nil, nil)
|
||||||
|
|
||||||
return p.startAll(wrappers)
|
return p.startAll(wrappers)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Project) startAll(wrappers map[string]*ServiceWrapper) error {
|
func (p *Project) startAll(wrappers map[string]*ServiceWrapper) error {
|
||||||
for name, _ := range p.Services {
|
for _, name := range p.reload {
|
||||||
if _, ok := wrappers[name]; !ok {
|
wrappers[name] = NewServiceWrapper(name, p)
|
||||||
wrappers[name] = NewServiceWrapper(name, p)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p.reload = []string{}
|
||||||
|
|
||||||
restart := false
|
restart := false
|
||||||
|
|
||||||
for _, wrapper := range wrappers {
|
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 {
|
type EnvironmentLookup interface {
|
||||||
Lookup(key, serviceName string, config *ServiceConfig) string
|
Lookup(key, serviceName string, config *ServiceConfig) []string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Project struct {
|
type Project struct {
|
||||||
EnvironmentLookup EnvironmentLookup
|
EnvironmentLookup EnvironmentLookup
|
||||||
Name string
|
Name string
|
||||||
configs map[string]*ServiceConfig
|
configs map[string]*ServiceConfig
|
||||||
|
reload []string
|
||||||
Services map[string]Service
|
Services map[string]Service
|
||||||
file string
|
file string
|
||||||
content []byte
|
content []byte
|
||||||
|
Loading…
Reference in New Issue
Block a user