fix: do not delete the destination scale file if it was not extracted previously
This commit is contained in:
@@ -52,10 +52,14 @@ func extractProcfile(appName, image string, procfilePath string) error {
|
||||
func extractOrGenerateScalefile(appName string, image string) error {
|
||||
destination := getScalefilePath(appName)
|
||||
extracted := getScalefileExtractedPath(appName)
|
||||
if err := common.CopyFromImage(appName, image, "DOKKU_SCALE", destination); err != nil {
|
||||
previouslyExtracted := common.FileExists(extracted)
|
||||
|
||||
if err := common.CopyFromImage(appName, image, "DOKKU_SCALE", extracted); err != nil {
|
||||
if previouslyExtracted {
|
||||
os.Remove(destination)
|
||||
}
|
||||
os.Remove(extracted)
|
||||
os.Remove(destination)
|
||||
} else if err := common.CopyFile(destination, extracted); err != nil {
|
||||
} else if err := common.CopyFile(extracted, destination); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -132,6 +132,7 @@ func TriggerPreDeploy(appName string, imageTag string) error {
|
||||
if err := extractProcfile(appName, image, procfilePath); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := extractOrGenerateScalefile(appName, imageTag); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user