mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 04:48:26 +08:00
build: split functionality into separate binaries
zot: registry server zli: zot cli to interact with the zot registry zui: zot ui (proposed) zb: zot benchmark (proposed) Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
committed by
Ramkumar Chinchani
parent
c4d34b7269
commit
4896adad1b
+31
-3
@@ -157,7 +157,8 @@ func newVerifyCmd(conf *config.Config) *cobra.Command {
|
||||
return verifyCmd
|
||||
}
|
||||
|
||||
func NewRootCmd() *cobra.Command {
|
||||
// "zot" - registry server.
|
||||
func NewServerRootCmd() *cobra.Command {
|
||||
showVersion := false
|
||||
conf := config.New()
|
||||
|
||||
@@ -175,12 +176,39 @@ func NewRootCmd() *cobra.Command {
|
||||
},
|
||||
}
|
||||
|
||||
// "serve"
|
||||
rootCmd.AddCommand(newServeCmd(conf))
|
||||
rootCmd.AddCommand(newScrubCmd(conf))
|
||||
// "verify"
|
||||
rootCmd.AddCommand(newVerifyCmd(conf))
|
||||
// "scrub"
|
||||
rootCmd.AddCommand(newScrubCmd(conf))
|
||||
// "version"
|
||||
rootCmd.Flags().BoolVarP(&showVersion, "version", "v", false, "show the version and exit")
|
||||
|
||||
return rootCmd
|
||||
}
|
||||
|
||||
// "zli" - client-side cli.
|
||||
func NewCliRootCmd() *cobra.Command {
|
||||
showVersion := false
|
||||
|
||||
rootCmd := &cobra.Command{
|
||||
Use: "zli",
|
||||
Short: "`zli`",
|
||||
Long: "`zli`",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if showVersion {
|
||||
log.Info().Str("distribution-spec", distspec.Version).Str("commit", config.Commit).
|
||||
Str("binary-type", config.BinaryType).Str("go version", config.GoVersion).Msg("version")
|
||||
}
|
||||
_ = cmd.Usage()
|
||||
cmd.SilenceErrors = false
|
||||
},
|
||||
}
|
||||
|
||||
// additional cmds
|
||||
enableCli(rootCmd)
|
||||
|
||||
// "version"
|
||||
rootCmd.Flags().BoolVarP(&showVersion, "version", "v", false, "show the version and exit")
|
||||
|
||||
return rootCmd
|
||||
|
||||
Reference in New Issue
Block a user