diff --git a/CHANGELOG.md b/CHANGELOG.md index e380ef03f31974aea6ed04521285a8c270603a1d..b3fc4ca40437bf07c92368bb931b9638d31af7c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +v 0.7.1 +- Fix caching support +- Suppress tar verbose output + v 0.7.0 - Refactor code structure - Refactor bash script adding pre-build and post-build steps diff --git a/VERSION b/VERSION index faef31a4357c48d6e4c55e84c8be8e3bc9055e20..39e898a4f952d339c155a7939d571a5fdd6c8cfc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.7.0 +0.7.1 diff --git a/commands/archive.go b/commands/archive.go index 0834c910d01f476826332930e7b83d422bdc1254..06bacb722821bbef663a0a3f059f33f89bcb1236 100644 --- a/commands/archive.go +++ b/commands/archive.go @@ -109,6 +109,7 @@ func (c *ArchiveCommand) processUntracked() { cmd.Env = os.Environ() cmd.Stdout = &output cmd.Stderr = os.Stderr + logrus.Debugln("Executing command:", strings.Join(cmd.Args, " ")) err := cmd.Run() if err == nil { reader := bufio.NewReader(&output) @@ -133,7 +134,7 @@ func (c *ArchiveCommand) archive() { return } - logrus.Infoln("Creating archive", c.Output, "...") + logrus.Infoln("Creating archive", filepath.Base(c.Output), "...") var files bytes.Buffer for _, file := range c.sortedFiles() { files.WriteString(string(file) + "\n") @@ -149,7 +150,7 @@ func (c *ArchiveCommand) archive() { tempFile.Close() defer os.Remove(tempFile.Name()) - logrus.Debugln("Temporary file", tempFile.Name()) + logrus.Debugln("Temporary file:", tempFile.Name()) flags := "-zcPv" if c.Silent { @@ -161,14 +162,15 @@ func (c *ArchiveCommand) archive() { cmd.Stdin = &files cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr + logrus.Debugln("Executing command:", strings.Join(cmd.Args, " ")) err = cmd.Run() if err != nil { - logrus.Fatalln("Failed to create archive", err) + logrus.Fatalln("Failed to create archive:", err) } err = os.Rename(tempFile.Name(), c.Output) if err != nil { - logrus.Warningln("Failed to rename archive", err) + logrus.Warningln("Failed to rename archive:", err) } logrus.Infoln("Done!") @@ -184,7 +186,7 @@ func (c *ArchiveCommand) Execute(context *cli.Context) { wd, err := os.Getwd() if err != nil { - logrus.Fatalln("Failed to get current working directory", err) + logrus.Fatalln("Failed to get current working directory:", err) } if c.Output == "" { logrus.Fatalln("Missing archive file name!") @@ -198,7 +200,7 @@ func (c *ArchiveCommand) Execute(context *cli.Context) { ai, err := os.Stat(c.Output) if err != nil && !os.IsNotExist(err) { - logrus.Fatalln("Failed to verify archive", c.Output, err) + logrus.Fatalln("Failed to verify archive:", c.Output, err) } if ai != nil { if !c.isChanged(ai.ModTime()) { diff --git a/shells/bash.go b/shells/bash.go index 2ac1a426244e4d666424266dbc1fa91e41dfbe9f..2f6427f87b23571e7299db548703152cae9c91aa 100644 --- a/shells/bash.go +++ b/shells/bash.go @@ -153,14 +153,14 @@ func (b *BashShell) generatePreBuildScript(info common.ShellScriptInfo) string { // If we have cache, restore it b.writeIfFile(w, cacheFile) b.echoColored(w, "Restoring cache...") - b.executeCommand(w, "tar", "-zxfv", "-f", cacheFile) + b.executeCommand(w, "tar", "-zxf", cacheFile) if cacheFile2 != "" { b.writeElse(w) // If we have cache, restore it b.writeIfFile(w, cacheFile2) b.echoColored(w, "Restoring cache...") - b.executeCommand(w, "tar", "-zxfv", "-f", cacheFile2) + b.executeCommand(w, "tar", "-zxf", cacheFile2) b.writeEndIf(w) } b.writeEndIf(w) @@ -205,7 +205,8 @@ func (b *BashShell) archiveFiles(w io.Writer, list interface{}, archiveType, arc args := []string{ "archive", - "-output", + "--silent", + "--output", archivePath, } @@ -213,14 +214,14 @@ func (b *BashShell) archiveFiles(w io.Writer, list interface{}, archiveType, arc if paths, ok := hash["paths"].([]interface{}); ok { for _, artifactPath := range paths { if file, ok := artifactPath.(string); ok { - args = append(args, "-path", file) + args = append(args, "--path", file) } } } // Archive also untracked files if untracked, ok := hash["untracked"].(bool); ok && untracked { - args = append(args, "-untracked") + args = append(args, "--untracked") } // Skip creating archive