diff --git a/commands/cloud_deploy.go b/commands/cloud_deploy.go index c4533464..2cd722cc 100644 --- a/commands/cloud_deploy.go +++ b/commands/cloud_deploy.go @@ -223,7 +223,7 @@ func (d *KoolDeploy) createReleaseFile() (filename string, err error) { } if len(allFiles) == 0 { - err = fmt.Errorf("no deploy config files found") + err = fmt.Errorf("no kool.cloud.yml config files found") return } @@ -238,6 +238,8 @@ func (d *KoolDeploy) createReleaseFile() (filename string, err error) { d.shell.Println(" -", file) } + tarball.SourceDir(d.env.Get("PWD")) + filename, err = tarball.CompressFiles(d.handleDeployEnv(allFiles)) if err == nil { diff --git a/commands/cloud_deploy_test.go b/commands/cloud_deploy_test.go index e3b946d2..655a97dd 100644 --- a/commands/cloud_deploy_test.go +++ b/commands/cloud_deploy_test.go @@ -76,7 +76,7 @@ func TestCreateReleaseFile(t *testing.T) { tmpDir := t.TempDir() fake.env.Set("PWD", tmpDir) - if _, err := fake.createReleaseFile(); err == nil || !strings.Contains(err.Error(), "no deploy config files found") { + if _, err := fake.createReleaseFile(); err == nil || !strings.Contains(err.Error(), "no kool.cloud.yml config files found") { t.Errorf("expected error on createReleaseFile when no kool.deploy.yml exists in current working directory; got: %v", err) } diff --git a/services/tgz/tgz.go b/services/tgz/tgz.go index f38b07d1..c1f66476 100644 --- a/services/tgz/tgz.go +++ b/services/tgz/tgz.go @@ -62,6 +62,11 @@ func (tgz *TarGz) CompressFiles(files []string) (tmpfile string, err error) { return } +// SourceDir defines the source directory that is going to be compressed +func (tgz *TarGz) SourceDir(dir string) { + tgz.sourceDir = dir +} + // CompressFolder adds the given folder to the tarball archive func (tgz *TarGz) CompressFolder(dir string) (tmpfile string, err error) { tgz.sourceDir = dir