Skip to content

Commit

Permalink
feat: display the action pipeline web URL
Browse files Browse the repository at this point in the history
Signed-off-by: Aris Buzachis <[email protected]>
  • Loading branch information
aris-bunnyshell committed Jan 12, 2024
1 parent 59d4d38 commit 1f7bd87
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/environment/action/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ func processEventPipeline(cmd *cobra.Command, event *sdk.EventItem, action strin
action,
pipeline.GetId(),
)

if pipeline.GetWebUrl() != "" {
cmd.Printf("\nPipeline details: %s\n\n", pipeline.GetWebUrl())
}
}

if err = progress.Pipeline(pipeline.GetId(), nil); err != nil {
Expand Down
4 changes: 4 additions & 0 deletions cmd/template/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ func init() {
RunE: func(cmd *cobra.Command, args []string) error {
listOptions.Organization = settings.Profile.Context.Organization

if listOptions.Source == "public" {
listOptions.Organization = ""
}

return lib.ShowCollection(cmd, listOptions, func() (lib.ModelWithPagination, error) {
return template.List(listOptions)
})
Expand Down
6 changes: 6 additions & 0 deletions pkg/formatter/stylish.pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,18 @@ func tabulatePipelineCollection(writer *tabwriter.Writer, data *sdk.PaginatedPip
}

func tabulatePipelineItem(writer *tabwriter.Writer, item *sdk.PipelineItem) {
hasWebUrl := item.GetWebUrl() != ""

Check failure on line 30 in pkg/formatter/stylish.pipeline.go

View workflow job for this annotation

GitHub Actions / audit

item.GetWebUrl undefined (type *sdk.PipelineItem has no field or method GetWebUrl)

fmt.Fprintf(writer, "%v\t %v\n", "PipelineID", item.GetId())
fmt.Fprintf(writer, "%v\t %v\n", "EnvironmentID", item.GetEnvironment())
fmt.Fprintf(writer, "%v\t %v\n", "OrganizationID", item.GetOrganization())
fmt.Fprintf(writer, "%v\t %v\n", "Description", item.GetDescription())
fmt.Fprintf(writer, "%v\t %v\n", "Status", item.GetStatus())

if hasWebUrl {
fmt.Fprintf(writer, "%v\t %v\n", "URL", item.GetWebUrl())

Check failure on line 39 in pkg/formatter/stylish.pipeline.go

View workflow job for this annotation

GitHub Actions / audit

item.GetWebUrl undefined (type *sdk.PipelineItem has no field or method GetWebUrl)
}

for index, stage := range item.GetStages() {
if index == 0 {
fmt.Fprintf(writer, "\n")
Expand Down

0 comments on commit 1f7bd87

Please sign in to comment.