diff --git a/README.md b/README.md index 624b671..2b51b99 100644 --- a/README.md +++ b/README.md @@ -54,18 +54,18 @@ tp trigger --help `trigger-pipeline` can automatically discover Jenkins servers created via the [Jenkins Operator](https://jenkinsci.github.io/kubernetes-operator/). -In addition you can register any Jenkins servers you wish to the Jenkins Server Registry via the `tp server add` command. +In addition you can register any Jenkins servers you wish to the Jenkins Server Registry via the `tp add` command. To add a new Jenkins server with a guided wizard: ``` -tp server add +tp add ``` If you already know the name, URL, username and API Token then you can use: ``` -tp server add +tp add ``` ### Removing Jenkins Servers @@ -73,7 +73,7 @@ tp server add You can remove a Jenkins server via: ``` -tp server remove +tp remove ``` Note that this only removes it from the registry; it doesn't affect the actual Jenkins Server. @@ -83,7 +83,7 @@ Note that this only removes it from the registry; it doesn't affect the actual J To list the servers you can use try: ``` -tp server list +tp list ``` ## How it works diff --git a/pkg/cmd/cmd.go b/pkg/cmd/cmd.go index 4306c89..db70d92 100644 --- a/pkg/cmd/cmd.go +++ b/pkg/cmd/cmd.go @@ -21,6 +21,9 @@ func NewCmd() *cobra.Command { }, } cmd.AddCommand(common.SplitCommand(trigger.NewCmdTrigger())) - cmd.AddCommand(server.NewCmdServer()) + cmd.AddCommand(common.SplitCommand(server.NewCmdAdd())) + cmd.AddCommand(common.SplitCommand(server.NewCmdDelete())) + cmd.AddCommand(common.SplitCommand(server.NewCmdJobs())) + cmd.AddCommand(common.SplitCommand(server.NewCmdList())) return cmd } diff --git a/pkg/cmd/server/server.go b/pkg/cmd/server/server.go deleted file mode 100644 index b8d2d33..0000000 --- a/pkg/cmd/server/server.go +++ /dev/null @@ -1,27 +0,0 @@ -package server - -import ( - "github.com/jenkins-x-labs/trigger-pipeline/pkg/common" - "github.com/jenkins-x/jx/pkg/log" - "github.com/spf13/cobra" -) - -// NewCmdServer creates the new command -func NewCmdServer() *cobra.Command { - command := &cobra.Command{ - Use: "server", - Short: "commands for working with Jenkins servers", - Aliases: []string{"servers", "jenkins"}, - Run: func(command *cobra.Command, args []string) { - err := command.Help() - if err != nil { - log.Logger().Errorf(err.Error()) - } - }, - } - command.AddCommand(common.SplitCommand(NewCmdAdd())) - command.AddCommand(common.SplitCommand(NewCmdDelete())) - command.AddCommand(common.SplitCommand(NewCmdJobs())) - command.AddCommand(common.SplitCommand(NewCmdList())) - return command -}