/
root.go
52 lines (49 loc) · 2.12 KB
/
root.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package cmd
import (
"github.com/jenkins-x/jx-helpers/v3/pkg/cobras"
"github.com/jenkins-x/jx-logging/v3/pkg/log"
"github.com/jenkins-x/jx-pipeline/pkg/cmd/activities"
"github.com/jenkins-x/jx-pipeline/pkg/cmd/convert"
"github.com/jenkins-x/jx-pipeline/pkg/cmd/effective"
"github.com/jenkins-x/jx-pipeline/pkg/cmd/fmt"
"github.com/jenkins-x/jx-pipeline/pkg/cmd/get"
"github.com/jenkins-x/jx-pipeline/pkg/cmd/getlog"
"github.com/jenkins-x/jx-pipeline/pkg/cmd/importcmd"
"github.com/jenkins-x/jx-pipeline/pkg/cmd/lint"
"github.com/jenkins-x/jx-pipeline/pkg/cmd/override"
"github.com/jenkins-x/jx-pipeline/pkg/cmd/pod"
"github.com/jenkins-x/jx-pipeline/pkg/cmd/start"
"github.com/jenkins-x/jx-pipeline/pkg/cmd/stop"
"github.com/jenkins-x/jx-pipeline/pkg/cmd/version"
"github.com/jenkins-x/jx-pipeline/pkg/cmd/wait"
"github.com/jenkins-x/jx-pipeline/pkg/rootcmd"
"github.com/spf13/cobra"
)
// Main creates the new command
func Main() *cobra.Command {
cmd := &cobra.Command{
Use: rootcmd.TopLevelCommand,
Short: "commands for working with Jenkins X Pipelines",
Run: func(cmd *cobra.Command, args []string) {
err := cmd.Help()
if err != nil {
log.Logger().Errorf(err.Error())
}
},
}
cmd.AddCommand(cobras.SplitCommand(activities.NewCmdActivities()))
cmd.AddCommand(cobras.SplitCommand(convert.NewCmdPipelineConvert()))
cmd.AddCommand(cobras.SplitCommand(effective.NewCmdPipelineEffective()))
cmd.AddCommand(cobras.SplitCommand(get.NewCmdPipelineGet()))
cmd.AddCommand(cobras.SplitCommand(getlog.NewCmdGetBuildLogs()))
cmd.AddCommand(cobras.SplitCommand(fmt.NewCmdPipelineFormat()))
cmd.AddCommand(cobras.SplitCommand(importcmd.NewCmdPipelineImport()))
cmd.AddCommand(cobras.SplitCommand(lint.NewCmdPipelineLint()))
cmd.AddCommand(cobras.SplitCommand(override.NewCmdPipelineOverride()))
cmd.AddCommand(cobras.SplitCommand(pod.NewCmdGetBuildPods()))
cmd.AddCommand(cobras.SplitCommand(start.NewCmdPipelineStart()))
cmd.AddCommand(cobras.SplitCommand(stop.NewCmdPipelineStop()))
cmd.AddCommand(cobras.SplitCommand(wait.NewCmdPipelineWait()))
cmd.AddCommand(cobras.SplitCommand(version.NewCmdVersion()))
return cmd
}