1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 06:40:31 +00:00

Refactor to use libcompose

This commit is contained in:
Darren Shepherd
2015-08-04 14:45:38 -07:00
parent 19f9a1b281
commit 9d76b79ac3
26 changed files with 665 additions and 1458 deletions

View File

@@ -8,11 +8,11 @@ import (
"strings"
log "github.com/Sirupsen/logrus"
"github.com/docker/libcompose/project"
"github.com/rancher/docker-from-scratch"
"github.com/rancherio/os/compose"
"github.com/rancherio/os/config"
"github.com/rancherio/os/docker"
"github.com/rancherio/os/util"
"github.com/rancherio/rancher-compose/librcompose/project"
)
func autoformat(cfg *config.CloudConfig) error {
@@ -23,16 +23,17 @@ func autoformat(cfg *config.CloudConfig) error {
FORMATZERO := "FORMATZERO=" + fmt.Sprint(cfg.Rancher.State.FormatZero)
cfg.Rancher.Autoformat["autoformat"].Environment = project.NewMaporEqualSlice([]string{AUTOFORMAT, FORMATZERO})
log.Info("Running Autoformat services")
err := docker.RunServices("autoformat", cfg, cfg.Rancher.Autoformat)
_, err := compose.RunServiceSet("autoformat", cfg, cfg.Rancher.Autoformat)
return err
}
func runBootstrapContainers(cfg *config.CloudConfig) error {
log.Info("Running Bootstrap services")
return docker.RunServices("bootstrap", cfg, cfg.Rancher.BootstrapContainers)
_, err := compose.RunServiceSet("bootstrap", cfg, cfg.Rancher.BootstrapContainers)
return err
}
func startDocker(cfg *config.Config) (chan interface{}, error) {
func startDocker(cfg *config.CloudConfig) (chan interface{}, error) {
launchConfig, args := getLaunchConfig(cfg, &cfg.Rancher.BootstrapDocker)
launchConfig.Fork = true