-
Notifications
You must be signed in to change notification settings - Fork 31
/
module.go
47 lines (44 loc) · 1.13 KB
/
module.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
package module
import (
"github.com/urfave/cli/v2"
"github.com/spacelift-io/spacectl/internal/cmd"
"github.com/spacelift-io/spacectl/internal/cmd/authenticated"
)
// Command encapsulates the module command subtree.
func Command() *cli.Command {
return &cli.Command{
Name: "module",
Usage: "Manage a Spacelift module",
Subcommands: []*cli.Command{
{
Category: "Module management",
Name: "create-version",
Usage: "Create a new version of a module",
Flags: []cli.Flag{
flagModuleID,
flagCommitSHA,
flagVersion,
},
Action: createVersion,
Before: authenticated.Ensure,
ArgsUsage: cmd.EmptyArgsUsage,
},
{
Category: "Module management",
Name: "local-preview",
Usage: "Start a preview (proposed version) based on the current project. Respects .gitignore and .terraformignore.",
Flags: []cli.Flag{
flagModuleID,
flagNoFindRepositoryRoot,
flagNoUpload,
flagRunMetadata,
flagDisregardGitignore,
flagTests,
},
Action: localPreview(),
Before: authenticated.Ensure,
ArgsUsage: cmd.EmptyArgsUsage,
},
},
}
}