fix: overwrite the in-repo Procfile with the desired Procfile
Without this change, herokuish and pack builds would not run the correct command as the Procfile could still be the old Procfile.
This commit is contained in:
1 parent
514a3efa5c
commit
e01730857c
1 file changed
+7
@@ -77,6 +77,7 @@ func TriggerCorePostExtract(appName string, sourceWorkDir string) error {
|
|||||||
b, _ := common.PlugnTriggerOutput("git-get-property", []string{appName, "source-image"}...)
|
b, _ := common.PlugnTriggerOutput("git-get-property", []string{appName, "source-image"}...)
|
||||||
appSourceImage := strings.TrimSpace(string(b[:]))
|
appSourceImage := strings.TrimSpace(string(b[:]))
|
||||||
|
|
||||||
|
repoDefaultProcfilePath := path.Join(sourceWorkDir, "Procfile")
|
||||||
if appSourceImage == "" {
|
if appSourceImage == "" {
|
||||||
repoProcfilePath := path.Join(sourceWorkDir, procfilePath)
|
repoProcfilePath := path.Join(sourceWorkDir, procfilePath)
|
||||||
if !common.FileExists(repoProcfilePath) {
|
if !common.FileExists(repoProcfilePath) {
|
||||||
@@ -91,6 +92,12 @@ func TriggerCorePostExtract(appName string, sourceWorkDir string) error {
|
|||||||
if err := copy.Copy(repoProcfilePath, processSpecificProcfile); err != nil {
|
if err := copy.Copy(repoProcfilePath, processSpecificProcfile); err != nil {
|
||||||
return fmt.Errorf("Unable to extract Procfile: %v", err.Error())
|
return fmt.Errorf("Unable to extract Procfile: %v", err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if procfilePath != "Procfile" {
|
||||||
|
if err := copy.Copy(repoProcfilePath, repoDefaultProcfilePath); err != nil {
|
||||||
|
return fmt.Errorf("Unable to move Procfile into place: %v", err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if err := common.CopyFromImage(appName, appSourceImage, procfilePath, processSpecificProcfile); err != nil {
|
if err := common.CopyFromImage(appName, appSourceImage, procfilePath, processSpecificProcfile); err != nil {
|
||||||
return common.TouchFile(fmt.Sprintf("%s.missing", processSpecificProcfile))
|
return common.TouchFile(fmt.Sprintf("%s.missing", processSpecificProcfile))
|
||||||
|
|||||||
Reference in new issue
Block a user