@@ -32,11 +32,16 @@ var deploymentName string
32
32
var deploymentCmd = & cobra.Command {
33
33
Use : "deployment" ,
34
34
Short : "Work with a deployment" ,
35
- Long : `Delopy a project` ,
35
+ Long : `Stack deployment command set.
36
+
37
+ The deployment commands generally need 3 things:
38
+ 1. a target (either explicitly with "-t <targetname> or defined in the config)
39
+ 2. a deployment name (either explicitly with -n <deployment name> or use the default name of "dep")
40
+ 3. a stack definition, this could be a supplied by any of the following ways:
41
+ - Provide a nitric.yaml configuration file, the path to which is provided either explicitly with "-s <stack dir> or in the current director.
42
+ - A Glob to the functions from which the configuration is derived.
43
+ ` ,
36
44
Example : `nitric deployment apply
37
- nitric deployment apply -n prod -s ../project/ -t prod
38
- nitric deployment apply -n prod -s ../project/ -t prod "functions/*.ts"
39
-
40
45
nitric deployment delete
41
46
nitric deployment list
42
47
` ,
@@ -46,6 +51,10 @@ var deploymentApplyCmd = &cobra.Command{
46
51
Use : "apply [handlerGlob]" ,
47
52
Short : "Create or Update a new application deployment" ,
48
53
Long : `Applies a Nitric application deployment.` ,
54
+ Example : `nitric deployment apply
55
+ nitric deployment apply -n prod-aws -s ../project/ -t prod
56
+ nitric deployment apply -n prod-aws -s ../project/ -t prod "functions/*.ts"
57
+ ` ,
49
58
Run : func (cmd * cobra.Command , args []string ) {
50
59
t , err := target .FromOptions ()
51
60
cobra .CheckErr (err )
@@ -71,9 +80,13 @@ var deploymentApplyCmd = &cobra.Command{
71
80
}
72
81
73
82
var deploymentDeleteCmd = & cobra.Command {
74
- Use : "delete [handlerGlob] " ,
83
+ Use : "delete" ,
75
84
Short : "Delete an application deployment" ,
76
85
Long : `Delete a Nitric application deployment.` ,
86
+ Example : `nitric deployment delete
87
+ nitric deployment delete -s ../project/ -t prod
88
+ nitric deployment delete -n prod-aws -s ../project/ -t prod
89
+ ` ,
77
90
Run : func (cmd * cobra.Command , args []string ) {
78
91
t , err := target .FromOptions ()
79
92
cobra .CheckErr (err )
@@ -86,24 +99,21 @@ var deploymentDeleteCmd = &cobra.Command{
86
99
87
100
cobra .CheckErr (p .Delete (deploymentName ))
88
101
},
89
- Args : cobra .MinimumNArgs (0 ),
102
+ Args : cobra .ExactArgs (0 ),
90
103
}
91
104
92
105
var deploymentListCmd = & cobra.Command {
93
- Use : "list [handlerGlob] " ,
106
+ Use : "list" ,
94
107
Short : "list deployments for a stack" ,
95
108
Long : `Lists Nitric application deployments for a stack.` ,
109
+ Example : `nitric list
110
+ nitric deployment list -s ../project/ -t prod
111
+ ` ,
96
112
Run : func (cmd * cobra.Command , args []string ) {
97
113
t , err := target .FromOptions ()
98
114
cobra .CheckErr (err )
99
115
100
- s , err := stack .FromOptions ()
101
- if err != nil && len (args ) > 0 {
102
- s , err = stack .FromGlobArgs (args )
103
- cobra .CheckErr (err )
104
-
105
- s , err = codeconfig .Populate (s )
106
- }
116
+ s , err := stack .FromOptionsMinimal ()
107
117
cobra .CheckErr (err )
108
118
109
119
p , err := provider .NewProvider (s , t )
@@ -114,7 +124,7 @@ var deploymentListCmd = &cobra.Command{
114
124
115
125
output .Print (deps )
116
126
},
117
- Args : cobra .MinimumNArgs (0 ),
127
+ Args : cobra .ExactArgs (0 ),
118
128
}
119
129
120
130
func RootCommand () * cobra.Command {
0 commit comments