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

Bump libcompose and its dependencies

This commit is contained in:
Josh Curl
2016-05-23 17:22:40 -07:00
parent c18cd26e78
commit 50de80d09a
1109 changed files with 35052 additions and 125685 deletions

View File

@@ -3,7 +3,6 @@ package command
import (
"github.com/codegangsta/cli"
"github.com/docker/libcompose/cli/app"
"github.com/docker/libcompose/project"
)
// CreateCommand defines the libcompose create subcommand.
@@ -12,6 +11,20 @@ func CreateCommand(factory app.ProjectFactory) cli.Command {
Name: "create",
Usage: "Create all services but do not start",
Action: app.WithProject(factory, app.ProjectCreate),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "no-recreate",
Usage: "If containers already exist, don't recreate them. Incompatible with --force-recreate.",
},
cli.BoolFlag{
Name: "force-recreate",
Usage: "Recreate containers even if their configuration and image haven't changed. Incompatible with --no-recreate.",
},
cli.BoolFlag{
Name: "no-build",
Usage: "Don't build an image, even if it's missing.",
},
},
}
}
@@ -21,6 +34,20 @@ func BuildCommand(factory app.ProjectFactory) cli.Command {
Name: "build",
Usage: "Build or rebuild services.",
Action: app.WithProject(factory, app.ProjectBuild),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "no-cache",
Usage: "Do not use cache when building the image",
},
cli.BoolFlag{
Name: "force-rm",
Usage: "Always remove intermediate containers",
},
cli.BoolFlag{
Name: "pull",
Usage: "Always attempt to pull a newer version of the image",
},
},
}
}
@@ -71,6 +98,10 @@ func UpCommand(factory app.ProjectFactory) cli.Command {
Name: "d",
Usage: "Do not block and log",
},
cli.BoolFlag{
Name: "no-build",
Usage: "Don't build an image, even if it's missing.",
},
cli.BoolFlag{
Name: "no-recreate",
Usage: "If containers already exist, don't recreate them. Incompatible with --force-recreate.",
@@ -98,12 +129,28 @@ func StartCommand(factory app.ProjectFactory) cli.Command {
}
}
// RunCommand defines the libcompose run subcommand.
func RunCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "run",
Usage: "Run a one-off command",
Action: app.WithProject(factory, app.ProjectRun),
Flags: []cli.Flag{},
}
}
// PullCommand defines the libcompose pull subcommand.
func PullCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "pull",
Usage: "Pulls images for services",
Action: app.WithProject(factory, app.ProjectPull),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "ignore-pull-failures",
Usage: "Pull what it can and ignores images with pull failures.",
},
},
}
}
@@ -119,6 +166,10 @@ func LogsCommand(factory app.ProjectFactory) cli.Command {
Usage: "number of lines to tail",
Value: 100,
},
cli.BoolFlag{
Name: "follow",
Usage: "Follow log output.",
},
},
}
}
@@ -142,10 +193,9 @@ func RestartCommand(factory app.ProjectFactory) cli.Command {
// StopCommand defines the libcompose stop subcommand.
func StopCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "stop",
ShortName: "down",
Usage: "Stop services",
Action: app.WithProject(factory, app.ProjectDown),
Name: "stop",
Usage: "Stop services",
Action: app.WithProject(factory, app.ProjectStop),
Flags: []cli.Flag{
cli.IntFlag{
Name: "timeout,t",
@@ -156,6 +206,29 @@ func StopCommand(factory app.ProjectFactory) cli.Command {
}
}
// DownCommand defines the libcompose stop subcommand.
func DownCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "down",
Usage: "Stop and remove containers, networks, images, and volumes",
Action: app.WithProject(factory, app.ProjectDown),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "volumes,v",
Usage: "Remove data volumes",
},
cli.StringFlag{
Name: "rmi",
Usage: "Remove images, type may be one of: 'all' to remove all images, or 'local' to remove only images that don't have an custom name set by the `image` field",
},
cli.BoolFlag{
Name: "remove-orphans",
Usage: "Remove containers for services not defined in the Compose file",
},
},
}
}
// ScaleCommand defines the libcompose scale subcommand.
func ScaleCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
@@ -207,41 +280,57 @@ func KillCommand(factory app.ProjectFactory) cli.Command {
}
}
// PauseCommand defines the libcompose pause subcommand.
func PauseCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "pause",
Usage: "Pause services.",
// ArgsUsage: "[SERVICE...]",
Action: app.WithProject(factory, app.ProjectPause),
}
}
// UnpauseCommand defines the libcompose unpause subcommand.
func UnpauseCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "unpause",
Usage: "Unpause services.",
// ArgsUsage: "[SERVICE...]",
Action: app.WithProject(factory, app.ProjectUnpause),
}
}
// VersionCommand defines the libcompose version subcommand.
func VersionCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "version",
Usage: "Show version informations",
Action: app.Version,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "short",
Usage: "Shows only Compose's version number.",
},
},
}
}
// CommonFlags defines the flags that are in common for all subcommands.
func CommonFlags() []cli.Flag {
return []cli.Flag{
cli.BoolFlag{
Name: "verbose,debug",
},
cli.StringFlag{
cli.StringSliceFlag{
Name: "file,f",
Usage: "Specify an alternate compose file (default: docker-compose.yml)",
Value: "docker-compose.yml",
Usage: "Specify one or more alternate compose files (default: docker-compose.yml)",
Value: &cli.StringSlice{},
EnvVar: "COMPOSE_FILE",
},
cli.StringFlag{
Name: "project-name,p",
Usage: "Specify an alternate project name (default: directory name)",
Name: "project-name,p",
Usage: "Specify an alternate project name (default: directory name)",
EnvVar: "COMPOSE_PROJECT_NAME",
},
}
}
// Populate updates the specified project context based on command line arguments and subcommands.
func Populate(context *project.Context, c *cli.Context) {
context.ComposeFile = c.GlobalString("file")
context.ProjectName = c.GlobalString("project-name")
if c.Command.Name == "logs" {
context.Log = true
} else if c.Command.Name == "up" {
context.Log = !c.Bool("d")
context.NoRecreate = c.Bool("no-recreate")
context.ForceRecreate = c.Bool("force-recreate")
} else if c.Command.Name == "stop" || c.Command.Name == "restart" || c.Command.Name == "scale" {
context.Timeout = uint(c.Int("timeout"))
} else if c.Command.Name == "kill" {
context.Signal = c.Int("signal")
} else if c.Command.Name == "rm" {
context.Volume = c.Bool("v")
}
}