Skip to content

Commit

Permalink
feat(deployments): add Image Size to the list of deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneM committed Feb 15, 2023
1 parent 9939ef9 commit c2d4627
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 167 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### To be Released

* feat(deployments): add Image Size to the list of deployments

### 1.27.2

* bump: go-scalingo v6.2.0
Expand Down
4 changes: 3 additions & 1 deletion deployments/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"time"

"github.com/dustin/go-humanize"
"github.com/olekukonko/tablewriter"
"gopkg.in/errgo.v1"

Expand All @@ -27,7 +28,7 @@ func List(ctx context.Context, app string, paginationOpts scalingo.PaginationOpt
}

t := tablewriter.NewWriter(os.Stdout)
t.SetHeader([]string{"ID", "Date", "Duration", "User", "Git Ref", "Status"})
t.SetHeader([]string{"ID", "Date", "Duration", "User", "Git Ref", "Status", "Image Size"})

for _, deployment := range deployments {
var duration string
Expand All @@ -43,6 +44,7 @@ func List(ctx context.Context, app string, paginationOpts scalingo.PaginationOpt
deployment.User.Username,
deployment.GitRef,
string(deployment.Status),
humanize.IBytes(deployment.ImageSize),
})
}
t.Render()
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.19
require (
github.com/AlecAivazis/survey/v2 v2.3.6
github.com/ScaleFT/sshkeys v1.2.0
github.com/Scalingo/go-scalingo/v6 v6.2.0
github.com/Scalingo/go-scalingo/v6 v6.2.1-0.20230215102927-196f73f370ad
github.com/Scalingo/go-utils/errors v1.1.1
github.com/Scalingo/go-utils/logger v1.2.0
github.com/Scalingo/go-utils/retry v1.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 h1:ra2OtmuW0A
github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8=
github.com/ScaleFT/sshkeys v1.2.0 h1:5BRp6rTVIhJzXT3VcUQrKgXR8zWA3sOsNeuyW15WUA8=
github.com/ScaleFT/sshkeys v1.2.0/go.mod h1:gxOHeajFfvGQh/fxlC8oOKBe23xnnJTif00IFFbiT+o=
github.com/Scalingo/go-scalingo/v6 v6.2.0 h1:Czr0aPyOWusrl190OQzqDr0dooYqYrfi/gl3bs/wRtQ=
github.com/Scalingo/go-scalingo/v6 v6.2.0/go.mod h1:Y3QByF4s5i3lpJh87c5FEkSN07CWomN5FPt0X/Qzg0I=
github.com/Scalingo/go-scalingo/v6 v6.2.1-0.20230215102927-196f73f370ad h1:uriDhbGKhaWY0Gkpu/LixJLmQ6ZTTitAatvMI6HcUTw=
github.com/Scalingo/go-scalingo/v6 v6.2.1-0.20230215102927-196f73f370ad/go.mod h1:Y3QByF4s5i3lpJh87c5FEkSN07CWomN5FPt0X/Qzg0I=
github.com/Scalingo/go-utils/errors v1.1.1 h1:G7zypaDBj0O6QFvX0xL5dMDXbiBgq+3KKuodldtOpg0=
github.com/Scalingo/go-utils/errors v1.1.1/go.mod h1:gsnGOMma5x3CSgPb8i5eMuHcKi3RvTJ9dWPNRev161c=
github.com/Scalingo/go-utils/logger v1.2.0 h1:E3jtaoRxpIsFcZu/jsvWew8ttUAwKUYQufdPqGYp7EU=
Expand Down

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

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

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

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

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

This file was deleted.

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

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ github.com/ProtonMail/go-crypto/openpgp/s2k
# github.com/ScaleFT/sshkeys v1.2.0
## explicit; go 1.13
github.com/ScaleFT/sshkeys
# github.com/Scalingo/go-scalingo/v6 v6.2.0
# github.com/Scalingo/go-scalingo/v6 v6.2.1-0.20230215102927-196f73f370ad
## explicit; go 1.17
github.com/Scalingo/go-scalingo/v6
github.com/Scalingo/go-scalingo/v6/billing
Expand Down

0 comments on commit c2d4627

Please sign in to comment.