feat: add ability to increase the max parallelism when deploying a given process type

This commit is contained in:
Jose Diaz-Gonzalez
2021-10-09 19:41:06 -04:00
parent 904894722f
commit 55554ce9bd
12 changed files with 97 additions and 12 deletions

View File

@@ -8,6 +8,32 @@ import (
"github.com/dokku/dokku/plugins/common"
)
// TriggerAppJSONProcessDeployParallelism returns the max number of processes to deploy in parallel
func TriggerAppJSONProcessDeployParallelism(appName string, processType string) error {
appJSON, err := getAppJSON(appName)
if err != nil {
return err
}
parallelism := 1
for procType, formation := range appJSON.Formation {
if procType != processType {
continue
}
if formation.MaxParallel == nil {
continue
}
if *formation.MaxParallel > 0 {
parallelism = *formation.MaxParallel
}
}
fmt.Println(parallelism)
return nil
}
// TriggerInstall initializes app restart policies
func TriggerInstall() error {
if err := common.PropertySetup("app-json"); err != nil {