|
|
@ -20,13 +20,12 @@ package main |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"bytes" |
|
|
|
"bytes" |
|
|
|
|
|
|
|
"flag" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"os" |
|
|
|
"os" |
|
|
|
"os/exec" |
|
|
|
"os/exec" |
|
|
|
"text/template" |
|
|
|
"text/template" |
|
|
|
"time" |
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/minio/cli" |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
type Version struct { |
|
|
|
type Version struct { |
|
|
@ -87,10 +86,7 @@ func (c command) String() string { |
|
|
|
return message |
|
|
|
return message |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func runMinioInstall(ctx *cli.Context) { |
|
|
|
func runMinioInstall() { |
|
|
|
if ctx.Args().First() == "help" { |
|
|
|
|
|
|
|
cli.ShowCommandHelpAndExit(ctx, "install", 1) // last argument is exit code
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
minioGenerate := command{exec.Command("godep", "go", "generate", "./..."), &bytes.Buffer{}, &bytes.Buffer{}} |
|
|
|
minioGenerate := command{exec.Command("godep", "go", "generate", "./..."), &bytes.Buffer{}, &bytes.Buffer{}} |
|
|
|
minioBuild := command{exec.Command("godep", "go", "build", "-a", "./..."), &bytes.Buffer{}, &bytes.Buffer{}} |
|
|
|
minioBuild := command{exec.Command("godep", "go", "build", "-a", "./..."), &bytes.Buffer{}, &bytes.Buffer{}} |
|
|
|
minioTest := command{exec.Command("godep", "go", "test", "-race", "./..."), &bytes.Buffer{}, &bytes.Buffer{}} |
|
|
|
minioTest := command{exec.Command("godep", "go", "test", "-race", "./..."), &bytes.Buffer{}, &bytes.Buffer{}} |
|
|
@ -121,10 +117,7 @@ func runMinioInstall(ctx *cli.Context) { |
|
|
|
fmt.Print(minioInstall) |
|
|
|
fmt.Print(minioInstall) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func runMinioRelease(ctx *cli.Context) { |
|
|
|
func runMinioRelease() { |
|
|
|
if ctx.Args().First() == "help" { |
|
|
|
|
|
|
|
cli.ShowCommandHelpAndExit(ctx, "release", 1) // last argument is exit code
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
t := time.Now().UTC() |
|
|
|
t := time.Now().UTC() |
|
|
|
date := t.Format(time.RFC3339Nano) |
|
|
|
date := t.Format(time.RFC3339Nano) |
|
|
|
version := Version{Date: date} |
|
|
|
version := Version{Date: date} |
|
|
@ -136,17 +129,15 @@ func runMinioRelease(ctx *cli.Context) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func main() { |
|
|
|
func main() { |
|
|
|
app := cli.NewApp() |
|
|
|
releaseFlag := flag.Bool("release", false, "make a release") |
|
|
|
app.Commands = []cli.Command{ |
|
|
|
installFlag := flag.Bool("install", false, "install minio") |
|
|
|
{ |
|
|
|
|
|
|
|
Name: "release", |
|
|
|
flag.Parse() |
|
|
|
Action: runMinioRelease, |
|
|
|
|
|
|
|
}, |
|
|
|
if *releaseFlag { |
|
|
|
{ |
|
|
|
runMinioRelease() |
|
|
|
Name: "install", |
|
|
|
} |
|
|
|
Action: runMinioInstall, |
|
|
|
if *installFlag { |
|
|
|
}, |
|
|
|
runMinioInstall() |
|
|
|
} |
|
|
|
} |
|
|
|
app.Author = "Minio.io" |
|
|
|
|
|
|
|
app.RunAndExitOnError() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|