diff --git a/docs/deployment/methods/herokuish-buildpacks.md b/docs/deployment/methods/herokuish-buildpacks.md index e9ece3787..60043d45a 100644 --- a/docs/deployment/methods/herokuish-buildpacks.md +++ b/docs/deployment/methods/herokuish-buildpacks.md @@ -140,6 +140,8 @@ The specified stack can also be unset by omitting the name of the stack when cal dokku buildpacks:stack-set node-js-app ``` +A change in the stack value will execute the `post-stack-set` trigger. + Finally, stacks can be set or unset globally as a fallback. This will take precedence over a globally set `DOKKU_IMAGE` environment variable (`gliderlabs/herokuish:latest` by default). ```shell diff --git a/plugins/buildpacks/subcommands.go b/plugins/buildpacks/subcommands.go index 0befb4625..e90ea4be4 100644 --- a/plugins/buildpacks/subcommands.go +++ b/plugins/buildpacks/subcommands.go @@ -141,6 +141,11 @@ func CommandSet(appName string, buildpack string, index int) error { // CommandStackSet implements buildpacks:stack-set func CommandStackSet(appName string, stack string) error { + oldStack := common.PropertyGet("buildpacks", appName, "stack") common.CommandPropertySet("buildpacks", appName, "stack", stack, DefaultProperties, GlobalProperties) - return common.PlugnTrigger("post-stack-set", []string{appName, stack}...) + if oldStack != stack { + return common.PlugnTrigger("post-stack-set", []string{appName, stack}...) + } + + return nil }