Skip to content

Commit

Permalink
Merge pull request #496 from kool-dev/patch-deploy
Browse files Browse the repository at this point in the history
patch tarball rel paths
  • Loading branch information
fabriciojs authored Jan 13, 2024
2 parents 2dd07a8 + 92b82a9 commit 5547d41
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion commands/cloud_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion commands/cloud_deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
5 changes: 5 additions & 0 deletions services/tgz/tgz.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5547d41

Please sign in to comment.