zot: initial commit

This commit is contained in:
Ramkumar Chinchani
2019-06-20 16:36:40 -07:00
parent 967ff15637
commit 9d4e8b4594
55 changed files with 6478 additions and 2 deletions
+28
View File
@@ -0,0 +1,28 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = ["main.go"],
importpath = "github.com/anuvu/zot/cmd/zot",
visibility = ["//visibility:private"],
deps = ["//pkg/cli:go_default_library"],
)
go_binary(
name = "zot",
embed = [":go_default_library"],
visibility = ["//visibility:public"],
)
go_test(
name = "go_default_test",
timeout = "short",
srcs = ["main_test.go"],
embed = [":go_default_library"],
race = "on",
deps = [
"//pkg/api:go_default_library",
"//pkg/cli:go_default_library",
"@com_github_smartystreets_goconvey//convey:go_default_library",
],
)
+13
View File
@@ -0,0 +1,13 @@
package main
import (
"os"
"github.com/anuvu/zot/pkg/cli"
)
func main() {
if err := cli.NewRootCmd().Execute(); err != nil {
os.Exit(1)
}
}
+22
View File
@@ -0,0 +1,22 @@
package main_test
import (
"testing"
"github.com/anuvu/zot/pkg/api"
"github.com/anuvu/zot/pkg/cli"
. "github.com/smartystreets/goconvey/convey"
)
func TestIntegration(t *testing.T) {
Convey("Make a new controller", t, func() {
config := api.NewConfig()
c := api.NewController(config)
So(c, ShouldNotBeNil)
cl := cli.NewRootCmd()
So(cl, ShouldNotBeNil)
So(cl.Execute(), ShouldBeNil)
})
}