Merge pull request #5272 from dokku/5269-global-config-trigger-flag
Add support for --global as app name when calling config-get trigger
This commit is contained in:
2 files changed
+13
-1
No files matched your search
@@ -172,7 +172,14 @@ func DockerCleanup(appName string, forceCleanup bool) error {
|
|||||||
if !forceCleanup {
|
if !forceCleanup {
|
||||||
skipCleanup := false
|
skipCleanup := false
|
||||||
if appName != "" {
|
if appName != "" {
|
||||||
b, _ := PlugnTriggerOutput("config-get", []string{appName, "DOKKU_SKIP_CLEANUP"}...)
|
triggerName := "config-get"
|
||||||
|
triggerArgs := []string{appName, "DOKKU_SKIP_CLEANUP"}
|
||||||
|
if appName == "--global" {
|
||||||
|
triggerName = "config-get-global"
|
||||||
|
triggerArgs = []string{"DOKKU_SKIP_CLEANUP"}
|
||||||
|
}
|
||||||
|
|
||||||
|
b, _ := PlugnTriggerOutput(triggerName, triggerArgs...)
|
||||||
output := strings.TrimSpace(string(b[:]))
|
output := strings.TrimSpace(string(b[:]))
|
||||||
if output == "true" {
|
if output == "true" {
|
||||||
skipCleanup = true
|
skipCleanup = true
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
parts := strings.Split(os.Args[0], "/")
|
parts := strings.Split(os.Args[0], "/")
|
||||||
trigger := parts[len(parts)-1]
|
trigger := parts[len(parts)-1]
|
||||||
|
global := flag.Bool("global", false, "--global: Whether global or app-specific")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
@@ -27,6 +28,10 @@ func main() {
|
|||||||
case "config-get":
|
case "config-get":
|
||||||
appName := flag.Arg(0)
|
appName := flag.Arg(0)
|
||||||
key := flag.Arg(1)
|
key := flag.Arg(1)
|
||||||
|
if *global {
|
||||||
|
appName = "--global"
|
||||||
|
key = flag.Arg(0)
|
||||||
|
}
|
||||||
err = config.TriggerConfigGet(appName, key)
|
err = config.TriggerConfigGet(appName, key)
|
||||||
case "config-get-global":
|
case "config-get-global":
|
||||||
key := flag.Arg(0)
|
key := flag.Arg(0)
|
||||||
|
|||||||
Reference in new issue
Block a user