Use tar to restore instead of archiver
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Adam Štrauch 2022-07-22 19:49:37 +02:00
parent 37d884e665
commit 96071cdfcb
Signed by: cx
GPG Key ID: 018304FFA8988F8D
1 changed files with 2 additions and 14 deletions

View File

@ -11,7 +11,6 @@ import (
"strings"
"time"
"github.com/mholt/archiver/v3"
"github.com/rosti-cz/node-api/apps/drivers"
uuid "github.com/satori/go.uuid"
)
@ -138,7 +137,7 @@ func (s *SnapshotProcessor) CreateSnapshot(appName string, labels []string) (str
return snapshot.KeyName(s.IndexLabel), fmt.Errorf("change working directory error: %v", err)
}
err = exec.Command("/usr/bin/tar", "-acvf", tmpSnapshotArchivePath, "./").Run()
err = exec.Command("/usr/bin/tar", "-acf", tmpSnapshotArchivePath, "./").Run()
if err != nil {
return snapshot.KeyName(s.IndexLabel), fmt.Errorf("compression error: %v", err)
}
@ -192,18 +191,7 @@ func (s *SnapshotProcessor) RestoreSnapshot(key string, newAppName string) error
return fmt.Errorf("getting the archive from S3 error: %v", err)
}
archive := archiver.TarZstd{
Tar: &archiver.Tar{
MkdirAll: true,
ContinueOnError: true,
OverwriteExisting: false,
ImplicitTopLevelFolder: false,
},
// CompressionLevel: 6,
// SelectiveCompression: true,
}
err = archive.Unarchive(tmpSnapshotArchivePath, "./")
err = exec.Command("/usr/bin/tar", "-axf", tmpSnapshotArchivePath).Run()
if err != nil {
return fmt.Errorf("unarchiving error: %v", err)
}