Merge pull request #4886 from dokku/apps-created-at

Add created-at time to apps:report output
This commit is contained in:
Jose Diaz-Gonzalez
2021-10-27 22:25:51 -04:00
committed by GitHub
2 changed files with 16 additions and 0 deletions

View File

@@ -243,16 +243,19 @@ dokku apps:report
```
=====> node-js-app app information
App created at: 1635126111
App dir: /home/dokku/node-js-app
App deploy source: git
App deploy source metadata: cd7b8afccb202f222e7dc7b427553e71ba5ddafd
App locked: false
=====> python-sample app information
App created at: 1635126000
App dir: /home/dokku/python-sample
App deploy source:
App deploy source metadata:
App locked: false
=====> ruby-sample app information
App created at: 1635122462
App dir: /home/dokku/ruby-sample
App deploy source: git
App deploy source metadata: c60921ea2799ca108276414b95ea197f16798d51

View File

@@ -1,6 +1,9 @@
package apps
import (
"fmt"
"os"
"github.com/dokku/dokku/plugins/common"
)
@@ -11,6 +14,7 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
}
flags := map[string]common.ReportFunc{
"--app-created-at": reportCreatedAt,
"--app-deploy-source": reportDeploySource,
"--app-deploy-source-metadata": reportDeploySourceMetadata,
"--app-dir": reportDir,
@@ -28,6 +32,15 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
return common.ReportSingleApp("app", appName, infoFlag, infoFlags, flagKeys, format, trimPrefix, uppercaseFirstCharacter)
}
func reportCreatedAt(appName string) string {
fi, err := os.Stat(common.AppRoot(appName))
if err != nil {
return ""
}
return fmt.Sprint(fi.ModTime().Unix())
}
func reportDeploySource(appName string) string {
return common.PropertyGet("apps", appName, "deploy-source")
}