[config] forward output from plugn triggers to user
This commit is contained in:
@@ -40,8 +40,7 @@ func SetMany(appName string, entries map[string]string, restart bool) (err error
|
||||
common.LogInfo1("Setting config vars")
|
||||
fmt.Println(prettyPrintEnvEntries(" ", entries))
|
||||
env.Write()
|
||||
args := append([]string{appName, "set"}, keys...)
|
||||
common.PlugnTrigger("post-config-update", args...)
|
||||
triggerUpdate(appName, "set", keys)
|
||||
}
|
||||
if !global && restart && env.GetBoolDefault("DOKKU_APP_RESTORE", true) {
|
||||
triggerRestart(appName)
|
||||
@@ -64,8 +63,7 @@ func UnsetMany(appName string, keys []string, restart bool) (err error) {
|
||||
}
|
||||
if changed {
|
||||
env.Write()
|
||||
args := append([]string{appName, "unset"}, keys...)
|
||||
common.PlugnTrigger("post-config-update", args...)
|
||||
triggerUpdate(appName, "unset", keys)
|
||||
}
|
||||
if !global && restart && env.GetBoolDefault("DOKKU_APP_RESTORE", true) {
|
||||
triggerRestart(appName)
|
||||
@@ -75,7 +73,14 @@ func UnsetMany(appName string, keys []string, restart bool) (err error) {
|
||||
|
||||
func triggerRestart(appName string) {
|
||||
common.LogInfo1(fmt.Sprintf("Restarting app %s", appName))
|
||||
common.PlugnTrigger("app-restart", appName)
|
||||
output, _ := common.PlugnTrigger("app-restart", appName)
|
||||
fmt.Printf(output)
|
||||
}
|
||||
|
||||
func triggerUpdate(appName string, operation string, args []string) {
|
||||
args = append([]string{appName, operation}, args...)
|
||||
output, _ := common.PlugnTrigger("post-config-update", args...)
|
||||
fmt.Printf(output)
|
||||
}
|
||||
|
||||
func loadAppOrGlobalEnv(appName string) (env *Env, err error) {
|
||||
|
||||
Reference in New Issue
Block a user