Change suffix to .tar.zst
All checks were successful
Unittests / unittests (push) Successful in 17s
Unittests / deploy-dev (push) Successful in 1m7s

This commit is contained in:
Adam Štrauch 2023-12-13 17:32:20 +01:00
parent 9564118f40
commit 6d62b200a4
Signed by: cx
GPG key ID: 7262DAFE292BCE20

View file

@ -206,9 +206,9 @@ func (p *Processor) Get(noUpdate bool) (apps.App, error) {
// Takes URL with an tar archive and prepares container's volume from it.
func (p *Processor) volumeFromURL(url string, container *docker.Container) error {
// Validation, check if url ends with tar.zstd
if !strings.HasSuffix(url, ".tar.zstd") {
return fmt.Errorf("archive has to end with .tar.zstd")
// Validation, check if url ends with tar.zst
if !strings.HasSuffix(url, ".tar.zst") {
return fmt.Errorf("archive has to end with .tar.zst")
}
volumePath := container.VolumeHostPath()
@ -221,7 +221,7 @@ func (p *Processor) volumeFromURL(url string, container *docker.Container) error
// Download the archive
log.Printf("%s: downloading archive from %s\n", container.App.Name, url)
f, err := os.Create(volumePath + "/archive.tar.zstd")
f, err := os.Create(volumePath + "/archive.tar.zst")
if err != nil {
return fmt.Errorf("failed to create archive file: %v", err)
}
@ -242,8 +242,8 @@ func (p *Processor) volumeFromURL(url string, container *docker.Container) error
// Extract the archive
log.Printf("%s: extracting archive\n", container.App.Name)
// Call tar xf archive.tar.zstd -C /volume
cmd := exec.Command("tar", "-I", "zstd", "-xf", "archive.tar.zstd", "-C", volumePath)
// Call tar xf archive.tar.zst -C /volume
cmd := exec.Command("tar", "-I", "zstd", "-xf", "archive.tar.zst", "-C", volumePath)
err = cmd.Run()
if err != nil {
log.Printf("%s: failed to extract archive: %v", container.App.Name, err)
@ -252,7 +252,7 @@ func (p *Processor) volumeFromURL(url string, container *docker.Container) error
// Remove archive
log.Printf("%s: removing archive\n", container.App.Name)
err = os.Remove(volumePath + "/archive.tar.zstd")
err = os.Remove(volumePath + "/archive.tar.zst")
if err != nil {
return fmt.Errorf("failed to remove archive: %v", err)
}