feat: implement ps-set-scale trigger
This commit is contained in:
@@ -1815,6 +1815,21 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `ps-set-scale`
|
||||
|
||||
- Description: Sets the scale for an app based on a specified formation (process-type=quantity). Any unspecified process types will be left as is.
|
||||
- Invoked by:
|
||||
- Arguments: `$APP $SKIP_DEPLOY [$PROCESS_TUPLE...]`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `receive-app`
|
||||
|
||||
- Description: Allows you to customize what occurs when an app is received. Normally just triggers an app build.
|
||||
|
||||
@@ -496,7 +496,7 @@ func setScale(appName string, image string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
args := []string{appName}
|
||||
args := []string{appName, "true"}
|
||||
for processType, formation := range appJSON.Formation {
|
||||
args = append(args, fmt.Sprintf("%s=%d", processType, formation.Quantity))
|
||||
}
|
||||
@@ -509,7 +509,7 @@ func setScale(appName string, image string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
return common.PlugnTrigger("ps-scale-set", args...)
|
||||
return common.PlugnTrigger("ps-set-scale", args...)
|
||||
}
|
||||
|
||||
func injectDokkuScale(appName string, image string) error {
|
||||
|
||||
@@ -75,6 +75,11 @@ func main() {
|
||||
case "procfile-remove":
|
||||
appName := flag.Arg(0)
|
||||
err = ps.TriggerProcfileRemove(appName)
|
||||
case "ps-set-scale":
|
||||
appName := flag.Arg(0)
|
||||
appName, args := common.ShiftString(flag.Args())
|
||||
skipDeploy, processTuples := common.ShiftString(args)
|
||||
err = ps.TriggerPsSetScale(appName, common.ToBool(skipDeploy), processTuples)
|
||||
case "ps-current-scale":
|
||||
appName := flag.Arg(0)
|
||||
err = ps.TriggerPsCurrentScale(appName)
|
||||
|
||||
@@ -282,3 +282,7 @@ func TriggerPsCurrentScale(appName string) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func TriggerPsSetScale(appName string, skipDeploy bool, processTuples []string) error {
|
||||
return scaleSet(appName, skipDeploy, processTuples)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user