-
Notifications
You must be signed in to change notification settings - Fork 784
/
step.go
68 lines (60 loc) · 2.05 KB
/
step.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package cmd
import (
"github.com/spf13/cobra"
)
// GetOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of
// referencing the cmd.Flags()
type StepOptions struct {
*CommonOptions
DisableImport bool
OutDir string
}
// NewCmdStep Steps a command object for the "step" command
func NewCmdStep(commonOpts *CommonOptions) *cobra.Command {
options := &StepOptions{
CommonOptions: commonOpts,
}
cmd := &cobra.Command{
Use: "step",
Short: "pipeline steps",
Aliases: []string{"steps"},
Run: func(cmd *cobra.Command, args []string) {
options.Cmd = cmd
options.Args = args
err := options.Run()
CheckErr(err)
},
}
cmd.AddCommand(NewCmdStepBuildPack(commonOpts))
cmd.AddCommand(NewCmdStepBDD(commonOpts))
cmd.AddCommand(NewCmdStepBlog(commonOpts))
cmd.AddCommand(NewCmdStepChangelog(commonOpts))
cmd.AddCommand(NewCmdStepCredential(commonOpts))
cmd.AddCommand(NewCmdStepCreate(commonOpts))
cmd.AddCommand(NewCmdStepCustomPipeline(commonOpts))
cmd.AddCommand(NewCmdStepEnv(commonOpts))
cmd.AddCommand(NewCmdStepGet(commonOpts))
cmd.AddCommand(NewCmdStepGit(commonOpts))
cmd.AddCommand(NewCmdStepGpgCredentials(commonOpts))
cmd.AddCommand(NewCmdStepHelm(commonOpts))
cmd.AddCommand(NewCmdStepLinkServices(commonOpts))
cmd.AddCommand(NewCmdStepNexus(commonOpts))
cmd.AddCommand(NewCmdStepNextVersion(commonOpts))
cmd.AddCommand(NewCmdStepNextBuildNumber(commonOpts))
cmd.AddCommand(NewCmdStepPre(commonOpts))
cmd.AddCommand(NewCmdStepPR(commonOpts))
cmd.AddCommand(NewCmdStepPost(commonOpts))
cmd.AddCommand(NewCmdStepRelease(commonOpts))
cmd.AddCommand(NewCmdStepSplitMonorepo(commonOpts))
cmd.AddCommand(NewCmdStepTag(commonOpts))
cmd.AddCommand(NewCmdStepValidate(commonOpts))
cmd.AddCommand(NewCmdStepVerify(commonOpts))
cmd.AddCommand(NewCmdStepWaitForArtifact(commonOpts))
cmd.AddCommand(NewCmdStepStash(commonOpts))
cmd.AddCommand(NewCmdStepUnstash(commonOpts))
return cmd
}
// Run implements this command
func (o *StepOptions) Run() error {
return o.Cmd.Help()
}