|
| 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