diff --git a/doc/reference/tooling/tt_cli/commands.rst b/doc/reference/tooling/tt_cli/commands.rst index 21d1d53dac..b63b0bacb5 100644 --- a/doc/reference/tooling/tt_cli/commands.rst +++ b/doc/reference/tooling/tt_cli/commands.rst @@ -40,6 +40,8 @@ help for the given command. - List enabled applications * - :doc:`logrotate ` - Rotate instance logs + * - :doc:`pack ` + - Package an application * - :doc:`play ` - Play the contents of ``.snap`` or ``.xlog`` files to another Tarantool instance * - :doc:`restart ` @@ -78,6 +80,7 @@ help for the given command. install instances logrotate + pack play restart rocks diff --git a/doc/reference/tooling/tt_cli/pack.rst b/doc/reference/tooling/tt_cli/pack.rst new file mode 100644 index 0000000000..6f07b2ba45 --- /dev/null +++ b/doc/reference/tooling/tt_cli/pack.rst @@ -0,0 +1,152 @@ +.. _tt-pack: + +Packaging the application +========================= + +.. code-block:: bash + + tt pack TYPE [options] .. + +``tt pack`` packages an application into a distributable bundle of the specified ``TYPE``: + +- ``tgz``: create a ``.tgz`` archive. +- ``deb``: create a DEB package. +- ``rpm``: create an RPM package. + +The command below creates a DEB package for an application: + + .. code-block:: console + + tt pack deb + +This command generates a ``.deb`` file whose name depends on the environment directory name and the operating system architecture, for example, ``test-env_0.1.0.0-1_x86_64.deb``. +You can also pass various :ref:`options ` to the ``tt pack`` command to adjust generation properties, for example, customize a bundle name, choose which artifacts should be included, specify the required application dependencies. + + +.. _tt-pack-options: + +Options +------- + +.. option:: --all + + Include all artifacts in a bundle. + In this case, a bundle might include snapshots, WAL files, and logs. + +.. option:: --app-list APPLICATIONS + + Specify the applications included in a bundle. + + **Example** + + .. code-block:: console + + tt pack tgz --app-list app1,app3 + +.. option:: --cartridge-compat + + **Applicable to:** ``tgz`` + + Package a Cartridge CLI-compatible archive. + +.. option:: --deps STRINGS + + **Applicable to:** ``deb``, ``rpm`` + + Specify dependencies included in RPM and DEB packages. + + **Example** + + .. code-block:: console + + tt pack deb --deps 'wget,make>0.1.0,unzip>1,unzip<=7' + +.. option:: --deps-file STRING + + **Applicable to:** ``deb``, ``rpm`` + + Specify the path to a file containing dependencies included in RPM and DEB packages. + For example, the ``package-deps.txt`` file below contains several dependencies and their versions: + + .. code-block:: text + + unzip==6.0 + neofetch>=6,<7 + gcc>8 + + If this file is placed in the current directory, a ``tt pack`` command might look like this: + + .. code-block:: console + + tt pack deb --deps-file package-deps.txt + +.. option:: --filename + + Specify a bundle name. + + **Example** + + .. code-block:: console + + tt pack tgz --filename sample-app.tar.gz + +.. option:: --name PACKAGE_NAME + + Specify a package name. + + **Example** + + .. code-block:: console + + tt pack tgz --name sample-app --version 1.0.1 + +.. option:: --preinst + + **Applicable to:** ``deb``, ``rpm`` + + Specify the path to a pre-install script for RPM and DEB packages. + + **Example** + + .. code-block:: console + + tt pack deb --preinst pre.sh + +.. option:: --postinst + + **Applicable to:** ``deb``, ``rpm`` + + Specify the path to a post-install script for RPM and DEB packages. + + **Example** + + .. code-block:: console + + tt pack deb --postinst post.sh + +.. option:: --use-docker + + Build a package in an Ubuntu 18.04 Docker container. + Before executing ``tt pack`` with this option, make sure Docker is running. + +.. option:: --version PACKAGE_VERSION + + Specify a package version. + + **Example** + + .. code-block:: console + + tt pack tgz --name sample-app --version 1.0.1 + +.. option:: --with-binaries + + Include Tarantool and ``tt`` binaries in a bundle. + +.. option:: --without-binaries + + Don't include Tarantool and ``tt`` binaries in a bundle. + +.. option:: --without-modules + + Don't include external modules in a bundle.