Skip to content

Commit

Permalink
feat(brig): Add AGE to brig build list (#545)
Browse files Browse the repository at this point in the history
This adds the AGE header with fuzzy durations to the `brig build list`
command.
  • Loading branch information
technosophos committed Jul 17, 2018
1 parent fb2b791 commit ac187ce
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions brig/cmd/brig/commands/build_list.go
Expand Up @@ -3,10 +3,13 @@ package commands
import (
"fmt"
"io"
"time"

"github.com/gosuri/uitable"
"github.com/spf13/cobra"

"k8s.io/apimachinery/pkg/util/duration"

"github.com/Azure/brigade/pkg/storage/kube"
)

Expand Down Expand Up @@ -41,14 +44,15 @@ func listBuilds(out io.Writer) error {
}

table := uitable.New()
table.AddRow("ID", "TYPE", "PROVIDER", "PROJECT", "STATUS")
table.AddRow("ID", "TYPE", "PROVIDER", "PROJECT", "STATUS", "AGE")

for _, b := range bs {
status := "???"
if b.Worker != nil {
status = b.Worker.Status.String()
}
table.AddRow(b.ID, b.Type, b.Provider, b.ProjectID, status)
since := duration.ShortHumanDuration(time.Since(b.Worker.EndTime))
table.AddRow(b.ID, b.Type, b.Provider, b.ProjectID, status, since)
}
fmt.Fprintln(out, table)
return nil
Expand Down
2 changes: 1 addition & 1 deletion brigade.js
Expand Up @@ -4,7 +4,7 @@
// ============================================================================
const { events, Job, Group} = require("brigadier")

const goImg = "golang:1.9"
const goImg = "golang:1.10"

function build(e, project) {
// This is a Go project, so we want to set it up for Go.
Expand Down

0 comments on commit ac187ce

Please sign in to comment.