feat: add support for formation key in app.json file

Still needs triggers for ps-can-scale and ps-scale-set.

Refs #4500
This commit is contained in:
Jose Diaz-Gonzalez
2021-03-22 00:24:56 -04:00
parent 9d0bc930a6
commit 6d9520e599
3 changed files with 52 additions and 8 deletions

View File

@@ -20,8 +20,9 @@ var (
// AppJSON is a struct that represents an app.json file as understood by Dokku
type AppJSON struct {
Cron []CronCommand `json:"cron"`
Scripts struct {
Cron []CronCommand `json:"cron"`
Formation map[string]Formation `json:"formation"`
Scripts struct {
Dokku struct {
Predeploy string `json:"predeploy"`
Postdeploy string `json:"postdeploy"`
@@ -36,6 +37,10 @@ type CronCommand struct {
Schedule string `json:"schedule"`
}
type Formation struct {
Quantity int `json:"quantity"`
}
// GetAppjsonDirectory returns the directory containing a given app's extracted app.json file
func GetAppjsonDirectory(appName string) string {
return filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "app-json", appName)