feat: implement resource:report

This commit is contained in:
Jose Diaz-Gonzalez
2019-03-18 16:43:31 -04:00
parent c9bbddcfcb
commit e8134f9c2c
6 changed files with 193 additions and 52 deletions

View File

@@ -0,0 +1,33 @@
package main
import (
"flag"
"strings"
"github.com/dokku/dokku/plugins/common"
"github.com/dokku/dokku/plugins/resource"
)
// displays a resource report for one or more apps
func main() {
flag.Parse()
appName := flag.Arg(1)
infoFlag := flag.Arg(2)
if strings.HasPrefix(appName, "--") {
common.LogFail("The resource:report command does not support flags without an app name")
}
if len(appName) == 0 {
apps, err := common.DokkuApps()
if err != nil {
return
}
for _, appName := range apps {
resource.ReportSingleApp(appName, infoFlag)
}
return
}
resource.ReportSingleApp(appName, infoFlag)
}

View File

@@ -0,0 +1,15 @@
package main
import (
"flag"
"github.com/dokku/dokku/plugins/resource"
)
// displays a buildpacks report for one or more apps
func main() {
flag.Parse()
appName := flag.Arg(0)
resource.ReportSingleApp(appName, "")
}