feat: implement ps-can-scale

This commit is contained in:
Jose Diaz-Gonzalez
2021-08-01 16:27:13 -04:00
parent 70eb751868
commit bd4621070c
3 changed files with 15 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ import (
"path"
"path/filepath"
"sort"
"strconv"
"strings"
sh "github.com/codeskyblue/go-sh"
@@ -265,6 +266,11 @@ func TriggerProcfileRemove(appName string) error {
return removeProcfile(appName)
}
// TriggerPsCanScale sets whether or not a user can scale an app with ps:scale
func TriggerPsCanScale(appName string, canScale bool) error {
return common.PropertyWrite("ps", appName, "can-scale", strconv.FormatBool(canScale))
}
// TriggerPsCurrentScale prints out the current scale contents (process-type=quantity) delimited by newlines
func TriggerPsCurrentScale(appName string) error {
formations, err := getFormations(appName)