Skip to content

Commit 524e910

Browse files
authored
Add tt init reference page (#3330)
Resolves #3323
1 parent d5bfec9 commit 524e910

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

doc/reference/tooling/tt_cli/commands.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ help for the given command.
3030
- Create an application from a template
3131
* - :doc:`help <help>`
3232
- Display help for ``tt`` or a specific command
33+
* - :doc:`init <init>`
34+
- Create a new ``tt`` environment in the current directory
3335
* - :doc:`logrotate <logrotate>`
3436
- Rotate instance logs
3537
* - :doc:`play <play>`

doc/reference/tooling/tt_cli/init.rst

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
.. _tt-init:
2+
3+
Creating a tt environment
4+
=========================
5+
6+
.. code-block:: bash
7+
8+
tt init
9+
10+
``tt init`` creates a ``tt`` environment in the current directory. This includes:
11+
12+
* Setting up directories for working files: binaries, templates, and so on.
13+
* Creating a corresponding ``tt.yaml`` :ref:`configuration file <tt-config_file>`.
14+
15+
Details
16+
-------
17+
18+
``tt init`` checks the existence of configuration files for Cartridge (``cartridge.yml``)
19+
or the ``tarantoolctl`` utility (``.tarantoolctl``) in the current directory.
20+
If such files are found, ``tt`` generates an environment that uses the same
21+
directories:
22+
23+
* ``cartridge.yml`` -- the directories specified in the file.
24+
* ``.tarantoolctl`` -- the directories specified in the ``default_cfg`` table.
25+
26+
.. note::
27+
28+
``init`` is the only ``tt`` command that invokes ``.tarantoolctl`` files.
29+
Thus, variables defined in this script will not be available in
30+
applications launched by a ``tt start`` call.
31+
32+
If there is no ``cartridge.yml`` or ``.tarantoolctl`` files in the current directory,
33+
``tt init`` creates a default environment in it. This includes creating the
34+
following directories and files:
35+
36+
* ``bin`` -- the directory for storing binary files.
37+
* ``include`` -- the directory for storing header files.
38+
* ``distfiles`` -- the directory for storing installation files.
39+
* ``instances.enabled`` -- the directory for storing running applications or symlinks.
40+
* ``modules`` -- the directory for storing external modules.
41+
* ``tt.yaml`` -- the configuration file.
42+
* ``templates`` -- the directory for storing application templates.
43+
44+
45+
Example
46+
--------
47+
48+
Create a ``tt`` environment in the current directory:
49+
50+
.. code-block:: bash
51+
52+
tt init

0 commit comments

Comments
 (0)