From 168b51d4022f8772a1a1a163b04a2748bc313b9a Mon Sep 17 00:00:00 2001 From: Arnaud Porterie Date: Tue, 6 Jan 2015 16:24:22 -0800 Subject: [PATCH] Basic skeleton for `dist` binary Signed-off-by: Arnaud Porterie --- cmd/dist/list.go | 14 ++++++++++++++ cmd/dist/main.go | 21 +++++++++++++++++++++ cmd/dist/pull.go | 21 +++++++++++++++++++++ cmd/dist/push.go | 21 +++++++++++++++++++++ 4 files changed, 77 insertions(+) create mode 100644 cmd/dist/list.go create mode 100644 cmd/dist/main.go create mode 100644 cmd/dist/pull.go create mode 100644 cmd/dist/push.go diff --git a/cmd/dist/list.go b/cmd/dist/list.go new file mode 100644 index 00000000..e540d4d8 --- /dev/null +++ b/cmd/dist/list.go @@ -0,0 +1,14 @@ +package main + +import "github.com/codegangsta/cli" + +var ( + commandList = cli.Command{ + Name: "images", + Usage: "List available images", + Action: imageList, + } +) + +func imageList(c *cli.Context) { +} diff --git a/cmd/dist/main.go b/cmd/dist/main.go new file mode 100644 index 00000000..34a2b514 --- /dev/null +++ b/cmd/dist/main.go @@ -0,0 +1,21 @@ +package main + +import ( + "os" + + "github.com/codegangsta/cli" +) + +func main() { + app := cli.NewApp() + app.Name = "dist" + app.Usage = "Package and ship Docker content" + + app.Action = commandList.Action + app.Commands = []cli.Command{ + commandList, + commandPull, + commandPush, + } + app.Run(os.Args) +} diff --git a/cmd/dist/pull.go b/cmd/dist/pull.go new file mode 100644 index 00000000..8f96129c --- /dev/null +++ b/cmd/dist/pull.go @@ -0,0 +1,21 @@ +package main + +import "github.com/codegangsta/cli" + +var ( + commandPull = cli.Command{ + Name: "pull", + Usage: "Pull and verify an image from a registry", + Action: imagePull, + Flags: []cli.Flag{ + cli.StringFlag{ + Name: "r,registry", + Value: "hub.docker.io", + Usage: "Registry to use (e.g.: localhost:5000)", + }, + }, + } +) + +func imagePull(c *cli.Context) { +} diff --git a/cmd/dist/push.go b/cmd/dist/push.go new file mode 100644 index 00000000..c39922aa --- /dev/null +++ b/cmd/dist/push.go @@ -0,0 +1,21 @@ +package main + +import "github.com/codegangsta/cli" + +var ( + commandPush = cli.Command{ + Name: "push", + Usage: "Push an image to a registry", + Action: imagePush, + Flags: []cli.Flag{ + cli.StringFlag{ + Name: "r,registry", + Value: "hub.docker.io", + Usage: "Registry to use (e.g.: localhost:5000)", + }, + }, + } +) + +func imagePush(*cli.Context) { +}