mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 12:58:02 +08:00
zot: initial commit
This commit is contained in:
@@ -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",
|
||||
],
|
||||
)
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user