|
|
@ -24,7 +24,7 @@ Usage: go run ci.go <command> <command flags/arguments> |
|
|
|
Available commands are: |
|
|
|
Available commands are: |
|
|
|
|
|
|
|
|
|
|
|
install [ -arch architecture ] [ packages... ] -- builds packages and executables |
|
|
|
install [ -arch architecture ] [ packages... ] -- builds packages and executables |
|
|
|
test [ -coverage ] [ -vet ] [ -misspell ] [ packages... ] -- runs the tests |
|
|
|
test [ -coverage ] [ -misspell ] [ packages... ] -- runs the tests |
|
|
|
archive [ -arch architecture ] [ -type zip|tar ] [ -signer key-envvar ] [ -upload dest ] -- archives build artefacts |
|
|
|
archive [ -arch architecture ] [ -type zip|tar ] [ -signer key-envvar ] [ -upload dest ] -- archives build artefacts |
|
|
|
importkeys -- imports signing keys from env |
|
|
|
importkeys -- imports signing keys from env |
|
|
|
debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package |
|
|
|
debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package |
|
|
@ -173,19 +173,7 @@ func doInstall(cmdline []string) { |
|
|
|
if flag.NArg() > 0 { |
|
|
|
if flag.NArg() > 0 { |
|
|
|
packages = flag.Args() |
|
|
|
packages = flag.Args() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
packages = build.ExpandPackagesNoVendor(packages) |
|
|
|
// Resolve ./... manually and remove vendor/bazil/fuse (fuse is not in windows)
|
|
|
|
|
|
|
|
out, err := goTool("list", "./...").CombinedOutput() |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
log.Fatalf("package listing failed: %v\n%s", err, string(out)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
packages = []string{} |
|
|
|
|
|
|
|
for _, line := range strings.Split(string(out), "\n") { |
|
|
|
|
|
|
|
if !strings.Contains(line, "vendor") { |
|
|
|
|
|
|
|
packages = append(packages, strings.TrimSpace(line)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if *arch == "" || *arch == runtime.GOARCH { |
|
|
|
if *arch == "" || *arch == runtime.GOARCH { |
|
|
|
goinstall := goTool("install", buildFlags(env)...) |
|
|
|
goinstall := goTool("install", buildFlags(env)...) |
|
|
@ -274,7 +262,6 @@ func goToolArch(arch string, subcmd string, args ...string) *exec.Cmd { |
|
|
|
|
|
|
|
|
|
|
|
func doTest(cmdline []string) { |
|
|
|
func doTest(cmdline []string) { |
|
|
|
var ( |
|
|
|
var ( |
|
|
|
vet = flag.Bool("vet", false, "Whether to run go vet") |
|
|
|
|
|
|
|
misspell = flag.Bool("misspell", false, "Whether to run the spell checker") |
|
|
|
misspell = flag.Bool("misspell", false, "Whether to run the spell checker") |
|
|
|
coverage = flag.Bool("coverage", false, "Whether to record code coverage") |
|
|
|
coverage = flag.Bool("coverage", false, "Whether to record code coverage") |
|
|
|
) |
|
|
|
) |
|
|
@ -284,23 +271,10 @@ func doTest(cmdline []string) { |
|
|
|
if len(flag.CommandLine.Args()) > 0 { |
|
|
|
if len(flag.CommandLine.Args()) > 0 { |
|
|
|
packages = flag.CommandLine.Args() |
|
|
|
packages = flag.CommandLine.Args() |
|
|
|
} |
|
|
|
} |
|
|
|
if len(packages) == 1 && packages[0] == "./..." { |
|
|
|
packages = build.ExpandPackagesNoVendor(packages) |
|
|
|
// Resolve ./... manually since go vet will fail on vendored stuff
|
|
|
|
|
|
|
|
out, err := goTool("list", "./...").CombinedOutput() |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
log.Fatalf("package listing failed: %v\n%s", err, string(out)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
packages = []string{} |
|
|
|
|
|
|
|
for _, line := range strings.Split(string(out), "\n") { |
|
|
|
|
|
|
|
if !strings.Contains(line, "vendor") { |
|
|
|
|
|
|
|
packages = append(packages, strings.TrimSpace(line)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// Run analysis tools before the tests.
|
|
|
|
// Run analysis tools before the tests.
|
|
|
|
if *vet { |
|
|
|
|
|
|
|
build.MustRun(goTool("vet", packages...)) |
|
|
|
build.MustRun(goTool("vet", packages...)) |
|
|
|
} |
|
|
|
|
|
|
|
if *misspell { |
|
|
|
if *misspell { |
|
|
|
spellcheck(packages) |
|
|
|
spellcheck(packages) |
|
|
|
} |
|
|
|
} |
|
|
|