1
0
mirror of https://github.com/prometheus-community/postgres_exporter.git synced 2025-11-25 10:43:13 +03:00

Updated the magefile.go to use new version of archiver library

This commit is contained in:
Kerim Djiho
2019-04-29 14:41:44 +02:00
committed by Will Rouesnel
parent 06781103f0
commit 6585e6672f

View File

@@ -587,13 +587,30 @@ func Release() error {
if platform.OS == "windows" { if platform.OS == "windows" {
// build a zip binary as well // build a zip binary as well
err := archiver.Zip.Make(fmt.Sprintf("%s.zip", platform.ReleaseBase()), []string{platform.ArchiveDir()})
// creates a Zip configuration
z := archiver.Zip{
CompressionLevel: 3,
MkdirAll: true,
SelectiveCompression: true,
ContinueOnError: false,
OverwriteExisting: false,
ImplicitTopLevelFolder: false,
}
err := z.Archive([]string{platform.ArchiveDir()}, fmt.Sprintf("%s.zip", platform.ReleaseBase()))
if err != nil { if err != nil {
return err return err
} }
} }
// build tar gz // build tar gz
err := archiver.TarGz.Make(fmt.Sprintf("%s.tar.gz", platform.ReleaseBase()), []string{platform.ArchiveDir()})
//creates TarGz configuration
t := archiver.TarGz{
CompressionLevel: 3,
}
err := t.Archive([]string{platform.ArchiveDir()}, fmt.Sprintf("%s.tar.gz", platform.ReleaseBase()))
if err != nil { if err != nil {
return err return err
} }