Merge pull request #4886 from dokku/apps-created-at
Add created-at time to apps:report output
This commit is contained in:
@@ -243,16 +243,19 @@ dokku apps:report
|
|||||||
|
|
||||||
```
|
```
|
||||||
=====> node-js-app app information
|
=====> node-js-app app information
|
||||||
|
App created at: 1635126111
|
||||||
App dir: /home/dokku/node-js-app
|
App dir: /home/dokku/node-js-app
|
||||||
App deploy source: git
|
App deploy source: git
|
||||||
App deploy source metadata: cd7b8afccb202f222e7dc7b427553e71ba5ddafd
|
App deploy source metadata: cd7b8afccb202f222e7dc7b427553e71ba5ddafd
|
||||||
App locked: false
|
App locked: false
|
||||||
=====> python-sample app information
|
=====> python-sample app information
|
||||||
|
App created at: 1635126000
|
||||||
App dir: /home/dokku/python-sample
|
App dir: /home/dokku/python-sample
|
||||||
App deploy source:
|
App deploy source:
|
||||||
App deploy source metadata:
|
App deploy source metadata:
|
||||||
App locked: false
|
App locked: false
|
||||||
=====> ruby-sample app information
|
=====> ruby-sample app information
|
||||||
|
App created at: 1635122462
|
||||||
App dir: /home/dokku/ruby-sample
|
App dir: /home/dokku/ruby-sample
|
||||||
App deploy source: git
|
App deploy source: git
|
||||||
App deploy source metadata: c60921ea2799ca108276414b95ea197f16798d51
|
App deploy source metadata: c60921ea2799ca108276414b95ea197f16798d51
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package apps
|
package apps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/dokku/dokku/plugins/common"
|
"github.com/dokku/dokku/plugins/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -11,6 +14,7 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
flags := map[string]common.ReportFunc{
|
flags := map[string]common.ReportFunc{
|
||||||
|
"--app-created-at": reportCreatedAt,
|
||||||
"--app-deploy-source": reportDeploySource,
|
"--app-deploy-source": reportDeploySource,
|
||||||
"--app-deploy-source-metadata": reportDeploySourceMetadata,
|
"--app-deploy-source-metadata": reportDeploySourceMetadata,
|
||||||
"--app-dir": reportDir,
|
"--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)
|
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 {
|
func reportDeploySource(appName string) string {
|
||||||
return common.PropertyGet("apps", appName, "deploy-source")
|
return common.PropertyGet("apps", appName, "deploy-source")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user