diff --git a/docs/development/plugin-triggers.md b/docs/development/plugin-triggers.md index fd3c6fb10..5a278a6b7 100644 --- a/docs/development/plugin-triggers.md +++ b/docs/development/plugin-triggers.md @@ -1481,7 +1481,7 @@ curl "https://dokku.me/starting/${APP}" || true - Description: Extracts a Procfile from a given image to a path - Invoked by: `internally` -- Arguments: `$APP $IMAGE $FORCE_EXTRACT $PROCFILE_PATH` +- Arguments: `$APP $IMAGE` - Example: ```shell diff --git a/plugins/app-json/appjson.go b/plugins/app-json/appjson.go index 05057cffa..bcb077ad4 100644 --- a/plugins/app-json/appjson.go +++ b/plugins/app-json/appjson.go @@ -110,10 +110,8 @@ func getPhaseScript(appName string, image string, phase string) (string, error) // getReleaseCommand extracts the release command from a given app's procfile func getReleaseCommand(appName string, image string) string { - forceExtract := "true" - err := common.SuppressOutput(func() error { - return common.PlugnTrigger("procfile-extract", []string{appName, image, forceExtract}...) + return common.PlugnTrigger("procfile-extract", []string{appName, image}...) }) if err != nil { diff --git a/plugins/ps/src/triggers/triggers.go b/plugins/ps/src/triggers/triggers.go index bf3eac8a8..d58084abe 100644 --- a/plugins/ps/src/triggers/triggers.go +++ b/plugins/ps/src/triggers/triggers.go @@ -54,9 +54,7 @@ func main() { case "procfile-extract": appName := flag.Arg(0) image := flag.Arg(1) - forceExtract := common.ToBool(flag.Arg(2)) - procfilePath := flag.Arg(3) - err = ps.TriggerProcfileExtract(appName, image, forceExtract, procfilePath) + err = ps.TriggerProcfileExtract(appName, image) case "procfile-get-command": appName := flag.Arg(0) processType := flag.Arg(1) diff --git a/plugins/ps/triggers.go b/plugins/ps/triggers.go index 656d2d603..1b8da30a1 100644 --- a/plugins/ps/triggers.go +++ b/plugins/ps/triggers.go @@ -139,21 +139,19 @@ func TriggerPreDeploy(appName string, imageTag string) error { return nil } -func TriggerProcfileExtract(appName string, image string, forceExtract bool, procfilePath string) error { - if procfilePath == "" { - directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "ps", appName) - if err := os.MkdirAll(directory, 0755); err != nil { - return err - } - - if err := common.SetPermissions(directory, 0755); err != nil { - return err - } - - procfilePath = getProcfilePath(appName) +func TriggerProcfileExtract(appName string, image string) error { + directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "ps", appName) + if err := os.MkdirAll(directory, 0755); err != nil { + return err } - if forceExtract { + if err := common.SetPermissions(directory, 0755); err != nil { + return err + } + + procfilePath := getProcfilePath(appName) + + if common.FileExists(procfilePath) { if err := common.PlugnTrigger("procfile-remove", []string{appName, procfilePath}...); err != nil { return err }