Merge pull request #4999 from elhu/4990-set-stack-global-cache

Purge cache for all apps when calling buildpacks:set-property with --global flag
This commit is contained in:
Jose Diaz-Gonzalez
2022-01-15 08:37:43 -05:00
committed by GitHub
2 changed files with 20 additions and 1 deletions

View File

@@ -148,7 +148,19 @@ func CommandSetProperty(appName string, property string, value string) error {
common.CommandPropertySet("buildpacks", appName, property, value, DefaultProperties, GlobalProperties)
if property == "stack" && oldStack != value {
return common.PlugnTrigger("post-stack-set", []string{appName, value}...)
if appName != "--global" {
return common.PlugnTrigger("post-stack-set", []string{appName, value}...)
}
apps, err := common.DokkuApps()
if err != nil {
return err
}
for _, app := range apps {
if err := common.PlugnTrigger("post-stack-set", []string{app, value}...); err != nil {
return err
}
}
}
return nil