Skip to content

Commit

Permalink
Merge pull request #54 from aris-bunnyshell/feat/pipeline-web-url
Browse files Browse the repository at this point in the history
feat: display the action pipeline web URL
  • Loading branch information
aris-bunnyshell committed Jan 12, 2024
2 parents 59d4d38 + b6ed9cb commit a7d2108
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.16

require (
bunnyshell.com/dev v0.5.6
bunnyshell.com/sdk v0.15.2
bunnyshell.com/sdk v0.15.3
github.com/AlecAivazis/survey/v2 v2.3.7
github.com/avast/retry-go/v4 v4.5.1
github.com/briandowns/spinner v1.23.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bunnyshell.com/dev v0.5.6 h1:C8vsLfjAqGW1pHOC8BBCDzu1/sPz/+x5ewccyyGmwF0=
bunnyshell.com/dev v0.5.6/go.mod h1:KlqPdOh60vqAfnuGUw9AKc0RVhXpNzWg46QKJSP/jog=
bunnyshell.com/sdk v0.15.2 h1:hgMAHtlsXfxlsUFs8obzVfvUphf13CyPtDxbrfNDeag=
bunnyshell.com/sdk v0.15.2/go.mod h1:RfgfUzZ4WHZGCkToUfu2/hoQS6XsQc8IdPTVAlpS138=
bunnyshell.com/sdk v0.15.3 h1:wH5RJqXGACphawbThyD8PMYzZB8fQGK/NwgW44lSu8U=
bunnyshell.com/sdk v0.15.3/go.mod h1:RfgfUzZ4WHZGCkToUfu2/hoQS6XsQc8IdPTVAlpS138=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
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() != ""

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())
}

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

0 comments on commit a7d2108

Please sign in to comment.