Skip to content

Commit

Permalink
pack: Added TCM file packaging Closes #TNTP-1097
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandrLitkevich committed Jan 27, 2025
1 parent 455053d commit 0548d48
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 83 deletions.
2 changes: 0 additions & 2 deletions cli/cmd/pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ func internalPackModule(cmdCtx *cmdcontext.CmdCtx, args []string) error {
return pack.PackInDocker(cmdCtx, packCtx, *cliOpts, os.Args)
}

fmt.Println("cliOpts", cliOpts.Env)

packer := pack.CreatePacker(packCtx)
if packer == nil {
return fmt.Errorf("incorrect type of package. Available types: rpm, deb, tgz")
Expand Down
2 changes: 0 additions & 2 deletions cli/cmdcontext/cmdcontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ type TarantoolCli struct {
type TcmCli struct {
// Executable is a path to tcm executable.
Executable string
// // Tcm version.
// version version.Version
}

// GetVersion returns and caches the tarantool version.
Expand Down
2 changes: 1 addition & 1 deletion cli/configure/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ func detectLocalTarantool(cmdCtx *cmdcontext.CmdCtx, cliOpts *config.CliOpts) er
if err != nil {
return err
}

if _, err := os.Stat(localTarantool); err == nil {
if _, err := exec.LookPath(localTarantool); err != nil {
return fmt.Errorf(`found Tarantool binary '%s' isn't executable: %s`,
Expand All @@ -525,7 +526,6 @@ func detectLocalTarantool(cmdCtx *cmdcontext.CmdCtx, cliOpts *config.CliOpts) er

cmdCtx.Cli.TarantoolCli.Executable = localTarantool
cmdCtx.Cli.IsTarantoolBinFromRepo = true

} else if !os.IsNotExist(err) {
return fmt.Errorf("failed to get access to Tarantool binary file: %s", err)
}
Expand Down
1 change: 0 additions & 1 deletion cli/pack/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ func copyBinaries(bundleEnvPath string, packCtx *PackCtx, cmdCtx *cmdcontext.Cmd
if err := os.MkdirAll(pkgBin, dirPermissions); err != nil {
return fmt.Errorf("failed to create binaries directory in bundle: %s", err)
}
fmt.Println("cmdCtx.Cli.TarantoolCli.Executable", cmdCtx.Cli.TarantoolCli.Executable)

// Copy tarantool.
if !packCtx.TarantoolIsSystem || packCtx.WithBinaries {
Expand Down
12 changes: 0 additions & 12 deletions demo/aap1/config.yml

This file was deleted.

4 changes: 0 additions & 4 deletions demo/aap1/init.lua

This file was deleted.

1 change: 0 additions & 1 deletion demo/aap1/instances.yml

This file was deleted.

Binary file removed demo/app1-0.1.0.0.arm64.tar.gz
Binary file not shown.
1 change: 0 additions & 1 deletion demo/instances.enabled/aap1

This file was deleted.

54 changes: 0 additions & 54 deletions demo/tt.yaml

This file was deleted.

7 changes: 2 additions & 5 deletions test/integration/pack/test_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,8 +801,8 @@ def test_pack_tgz_compat_with_binaries(tt_cmd, tmp_path):
[tt_cmd, "run"],
cwd=app_path, env=dict(os.environ, PWD=app_path))

# assert rc == 0
# assert output == "Hello World"
assert rc == 0
assert output == "Hello World"


def test_pack_tgz_multiple_apps_compat(tt_cmd, tmp_path):
Expand Down Expand Up @@ -993,13 +993,10 @@ def test_pack_tgz_links_to_binaries(tt_cmd, tmp_path):
dirs_exist_ok=True)

base_dir = tmp_path
path = os.environ.get('PATH')
print(f"PATH1 ==={path}")

rc, output = run_command_and_get_output(
[tt_cmd, "pack", "tgz"],
cwd=base_dir, env=dict(os.environ, PWD=base_dir))
print(f"PATH2 ==={path}")

assert rc == 0

Expand Down

0 comments on commit 0548d48

Please sign in to comment.