Use property system to set when an app has been created
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
@@ -35,6 +36,10 @@ func createApp(appName string) error {
|
||||
common.LogInfo1Quiet(fmt.Sprintf("Creating %s...", appName))
|
||||
os.MkdirAll(common.AppRoot(appName), 0755)
|
||||
|
||||
if err := common.PropertyWrite("apps", appName, "created-at", fmt.Sprintf("%d", time.Now().Unix())); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := common.PlugnTrigger("post-create", []string{appName}...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package apps
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
@@ -33,12 +33,11 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
|
||||
}
|
||||
|
||||
func reportCreatedAt(appName string) string {
|
||||
fi, err := os.Stat(common.AppRoot(appName))
|
||||
createdAt, err := common.PropertyListGet("apps", appName, "created-at")
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return fmt.Sprint(fi.ModTime().Unix())
|
||||
return fmt.Sprint(strings.Join(createdAt, ","))
|
||||
}
|
||||
|
||||
func reportDeploySource(appName string) string {
|
||||
|
||||
Reference in New Issue
Block a user