Skip to content

Commit 5547d41

Browse files
authored
Merge pull request #496 from kool-dev/patch-deploy
patch tarball rel paths
2 parents 2dd07a8 + 92b82a9 commit 5547d41

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

commands/cloud_deploy.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ func (d *KoolDeploy) createReleaseFile() (filename string, err error) {
223223
}
224224

225225
if len(allFiles) == 0 {
226-
err = fmt.Errorf("no deploy config files found")
226+
err = fmt.Errorf("no kool.cloud.yml config files found")
227227
return
228228
}
229229

@@ -238,6 +238,8 @@ func (d *KoolDeploy) createReleaseFile() (filename string, err error) {
238238
d.shell.Println(" -", file)
239239
}
240240

241+
tarball.SourceDir(d.env.Get("PWD"))
242+
241243
filename, err = tarball.CompressFiles(d.handleDeployEnv(allFiles))
242244

243245
if err == nil {

commands/cloud_deploy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func TestCreateReleaseFile(t *testing.T) {
7676
tmpDir := t.TempDir()
7777
fake.env.Set("PWD", tmpDir)
7878

79-
if _, err := fake.createReleaseFile(); err == nil || !strings.Contains(err.Error(), "no deploy config files found") {
79+
if _, err := fake.createReleaseFile(); err == nil || !strings.Contains(err.Error(), "no kool.cloud.yml config files found") {
8080
t.Errorf("expected error on createReleaseFile when no kool.deploy.yml exists in current working directory; got: %v", err)
8181
}
8282

services/tgz/tgz.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ func (tgz *TarGz) CompressFiles(files []string) (tmpfile string, err error) {
6262
return
6363
}
6464

65+
// SourceDir defines the source directory that is going to be compressed
66+
func (tgz *TarGz) SourceDir(dir string) {
67+
tgz.sourceDir = dir
68+
}
69+
6570
// CompressFolder adds the given folder to the tarball archive
6671
func (tgz *TarGz) CompressFolder(dir string) (tmpfile string, err error) {
6772
tgz.sourceDir = dir

0 commit comments

Comments
 (0)