Skip to content

Add tt init reference page #3330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/reference/tooling/tt_cli/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ help for the given command.
- Create an application from a template
* - :doc:`help <help>`
- Display help for ``tt`` or a specific command
* - :doc:`init <init>`
- Create a new ``tt`` environment in the current directory
* - :doc:`logrotate <logrotate>`
- Rotate instance logs
* - :doc:`play <play>`
Expand Down
52 changes: 52 additions & 0 deletions doc/reference/tooling/tt_cli/init.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.. _tt-init:

Creating a tt environment
=========================

.. code-block:: bash

tt init

``tt init`` creates a ``tt`` environment in the current directory. This includes:

* Setting up directories for working files: binaries, templates, and so on.
* Creating a corresponding ``tt.yaml`` :ref:`configuration file <tt-config_file>`.

Details
-------

``tt init`` checks the existence of configuration files for Cartridge (``cartridge.yml``)
or the ``tarantoolctl`` utility (``.tarantoolctl``) in the current directory.
If such files are found, ``tt`` generates an environment that uses the same
directories:

* ``cartridge.yml`` -- the directories specified in the file.
* ``.tarantoolctl`` -- the directories specified in the ``default_cfg`` table.

.. note::

``init`` is the only ``tt`` command that invokes ``.tarantoolctl`` files.
Thus, variables defined in this script will not be available in
applications launched by a ``tt start`` call.

If there is no ``cartridge.yml`` or ``.tarantoolctl`` files in the current directory,
``tt init`` creates a default environment in it. This includes creating the
following directories and files:

* ``bin`` -- the directory for storing binary files.
* ``include`` -- the directory for storing header files.
* ``distfiles`` -- the directory for storing installation files.
* ``instances.enabled`` -- the directory for storing running applications or symlinks.
* ``modules`` -- the directory for storing external modules.
* ``tt.yaml`` -- the configuration file.
* ``templates`` -- the directory for storing application templates.


Example
--------

Create a ``tt`` environment in the current directory:

.. code-block:: bash

tt init