refactor: drop extra args from procfile-extract
They were not necessary.
This commit is contained in:
1 parent
06ce3dfadb
commit
f9969a0e61
4 files changed
+14
-20
No files matched your search
@@ -1481,7 +1481,7 @@ curl "https://dokku.me/starting/${APP}" || true
|
|||||||
|
|
||||||
- Description: Extracts a Procfile from a given image to a path
|
- Description: Extracts a Procfile from a given image to a path
|
||||||
- Invoked by: `internally`
|
- Invoked by: `internally`
|
||||||
- Arguments: `$APP $IMAGE $FORCE_EXTRACT $PROCFILE_PATH`
|
- Arguments: `$APP $IMAGE`
|
||||||
- Example:
|
- Example:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@@ -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
|
// getReleaseCommand extracts the release command from a given app's procfile
|
||||||
func getReleaseCommand(appName string, image string) string {
|
func getReleaseCommand(appName string, image string) string {
|
||||||
forceExtract := "true"
|
|
||||||
|
|
||||||
err := common.SuppressOutput(func() error {
|
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 {
|
if err != nil {
|
||||||
|
|||||||
@@ -54,9 +54,7 @@ func main() {
|
|||||||
case "procfile-extract":
|
case "procfile-extract":
|
||||||
appName := flag.Arg(0)
|
appName := flag.Arg(0)
|
||||||
image := flag.Arg(1)
|
image := flag.Arg(1)
|
||||||
forceExtract := common.ToBool(flag.Arg(2))
|
err = ps.TriggerProcfileExtract(appName, image)
|
||||||
procfilePath := flag.Arg(3)
|
|
||||||
err = ps.TriggerProcfileExtract(appName, image, forceExtract, procfilePath)
|
|
||||||
case "procfile-get-command":
|
case "procfile-get-command":
|
||||||
appName := flag.Arg(0)
|
appName := flag.Arg(0)
|
||||||
processType := flag.Arg(1)
|
processType := flag.Arg(1)
|
||||||
|
|||||||
+11
-13
@@ -139,21 +139,19 @@ func TriggerPreDeploy(appName string, imageTag string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func TriggerProcfileExtract(appName string, image string, forceExtract bool, procfilePath string) error {
|
func TriggerProcfileExtract(appName string, image string) error {
|
||||||
if procfilePath == "" {
|
directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "ps", appName)
|
||||||
directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "ps", appName)
|
if err := os.MkdirAll(directory, 0755); err != nil {
|
||||||
if err := os.MkdirAll(directory, 0755); err != nil {
|
return err
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := common.SetPermissions(directory, 0755); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
procfilePath = getProcfilePath(appName)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
if err := common.PlugnTrigger("procfile-remove", []string{appName, procfilePath}...); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user