@@ -149,6 +149,10 @@ This returns information about a deployment, the logs of this build can also be
149149 if err != nil {
150150 return err
151151 }
152+ wide , err := cmd .Flags ().GetBool ("wide" )
153+ if err != nil {
154+ return err
155+ }
152156 showLogs , err := cmd .Flags ().GetBool ("logs" )
153157 if err != nil {
154158 return err
@@ -184,27 +188,35 @@ This returns information about a deployment, the logs of this build can also be
184188 fmt .Fprintf (cmd .OutOrStdout (), "%s" , r )
185189 return nil
186190 }
191+ data := []output.Data {}
192+ dep := []string {
193+ returnNonEmptyString (fmt .Sprintf ("%v" , deployment .ID )),
194+ returnNonEmptyString (fmt .Sprintf ("%v" , deployment .Name )),
195+ returnNonEmptyString (fmt .Sprintf ("%v" , deployment .Status )),
196+ returnNonEmptyString (fmt .Sprintf ("%v" , deployment .BuildStep )),
197+ returnNonEmptyString (fmt .Sprintf ("%v" , deployment .Started )),
198+ returnNonEmptyString (fmt .Sprintf ("%v" , deployment .Completed )),
199+ }
200+ if wide {
201+ dep = append (dep , returnNonEmptyString (fmt .Sprintf ("%v" , deployment .Created )))
202+ dep = append (dep , returnNonEmptyString (fmt .Sprintf ("%v" , deployment .RemoteID )))
203+ }
204+ data = append (data , dep )
205+ header := []string {
206+ "ID" ,
207+ "Name" ,
208+ "Status" ,
209+ "BuildStep" ,
210+ "Started" ,
211+ "Completed" ,
212+ }
213+ if wide {
214+ header = append (header , "Created" )
215+ header = append (header , "RemoteID" )
216+ }
187217 dataMain := output.Table {
188- Header : []string {
189- "ID" ,
190- "RemoteID" ,
191- "Name" ,
192- "Status" ,
193- "Created" ,
194- "Started" ,
195- "Completed" ,
196- },
197- Data : []output.Data {
198- {
199- returnNonEmptyString (fmt .Sprintf ("%v" , deployment .ID )),
200- returnNonEmptyString (fmt .Sprintf ("%v" , deployment .RemoteID )),
201- returnNonEmptyString (fmt .Sprintf ("%v" , deployment .Name )),
202- returnNonEmptyString (fmt .Sprintf ("%v" , deployment .Status )),
203- returnNonEmptyString (fmt .Sprintf ("%v" , deployment .Created )),
204- returnNonEmptyString (fmt .Sprintf ("%v" , deployment .Started )),
205- returnNonEmptyString (fmt .Sprintf ("%v" , deployment .Completed )),
206- },
207- },
218+ Header : header ,
219+ Data : data ,
208220 }
209221 r := output .RenderOutput (dataMain , outputOptions )
210222 fmt .Fprintf (cmd .OutOrStdout (), "%s" , r )
@@ -447,6 +459,7 @@ func init() {
447459 getProjectKeyCmd .Flags ().BoolVarP (& revealValue , "reveal" , "" , false , "Reveal the variable values" )
448460 getDeploymentByNameCmd .Flags ().StringP ("name" , "N" , "" , "The name of the deployment (eg, lagoon-build-abcdef)" )
449461 getDeploymentByNameCmd .Flags ().BoolP ("logs" , "L" , false , "Show the build logs if available" )
462+ getDeploymentByNameCmd .Flags ().Bool ("wide" , false , "Display additional information about deployments" )
450463 getOrganizationCmd .Flags ().StringP ("organization-name" , "O" , "" , "Name of the organization" )
451464 getEnvironmentCmd .Flags ().Bool ("wide" , false , "Display additional information about the environment" )
452465 getProjectCmd .Flags ().Bool ("wide" , false , "Display additional information about the project" )
0 commit comments