build: compress build artifacts using gzip (#168)

- Change the compression format from `tar` to `tar.gz`
- Replace the flag `-cf` with `-zcf` in the `buildArgs` function

fix https://github.com/appleboy/drone-scp/issues/123
This commit is contained in:
Bo-Yi Wu
2023-04-09 12:38:12 +08:00
committed by GitHub
parent 9d8fc691c1
commit 9bfb71b9ef
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -579,7 +579,7 @@ func TestBuildArgs(t *testing.T) {
}
result := buildArgs("test.tar.gz", list)
expects := []string{"--exclude", "tests/a.txt", "--exclude", "tests/b.txt", "-cf", "test.tar.gz", "tests/a.txt", "tests/b.txt", "tests/c.txt"}
expects := []string{"--exclude", "tests/a.txt", "--exclude", "tests/b.txt", "-zcf", "test.tar.gz", "tests/a.txt", "tests/b.txt", "tests/c.txt"}
assert.Equal(t, expects, result)
list = fileList{
@@ -587,7 +587,7 @@ func TestBuildArgs(t *testing.T) {
}
result = buildArgs("test.tar.gz", list)
expects = []string{"-cf", "test.tar.gz", "tests/a.txt", "tests/b.txt"}
expects = []string{"-zcf", "test.tar.gz", "tests/a.txt", "tests/b.txt"}
assert.Equal(t, expects, result)
}