Skip to content

Commit 316216b

Browse files
authored
Add env variables that tt CLI uses (#4167)
Resolves #3828
1 parent 739976c commit 316216b

File tree

4 files changed

+102
-12
lines changed

4 files changed

+102
-12
lines changed

doc/reference/tooling/tt_cli/configuration.rst

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ env section
6464
* ``inc_dir`` -- the base directory for storing header files. They will
6565
be placed in the ``include`` subdirectory inside the specified directory.
6666
Default: ``include``.
67+
68+
.. note::
69+
70+
The header files directory path can also be passed using the ``TT_CLI_TARANTOOL_PREFIX``
71+
environment variable. If it is set, ``tt rocks`` and ``tt build`` commands use the
72+
``include/tarantool`` directory inside ``TT_CLI_TARANTOOL_PREFIX`` as the
73+
header files directory.
74+
6775
* ``restart_on_failure`` -- restart the instance on failure: ``true`` or ``false``.
6876
Default: ``false``.
6977
* ``tarantoolctl_layout`` -- use a layout compatible with the deprecated ``tarantoolctl``
@@ -108,6 +116,13 @@ repo section
108116
~~~~~~~~~~~~
109117

110118
* ``rocks`` -- the directory where rocks files are stored.
119+
120+
.. note::
121+
122+
The rocks directory path can be passed in the ``TT_CLI_REPO_ROCKS``
123+
environment variable instead. The variable is also used if the directory
124+
specified in ``repo.rocks`` does not include a repository manifest.
125+
111126
* ``distfiles`` -- the directory where installation files are stored.
112127

113128
.. _tt-config_file_ee:
@@ -116,7 +131,15 @@ ee section
116131
~~~~~~~~~~
117132

118133
* ``credential_path`` -- a path to the file with credentials used for
119-
downloading Tarantool Enterprise Edition.
134+
downloading Tarantool Enterprise Edition (Tarantool customer zone credentials).
135+
The file should contain a username and a password, each on a separate line.
136+
Find an example in the :ref:`tt install <tt-install-authentication>` command
137+
reference.
138+
139+
.. note::
140+
141+
The customer zone credentials can also be passed in the
142+
``TT_CLI_EE_USERNAME`` and ``TT_CLI_EE_PASSWORD`` environment variables.
120143

121144
templates section
122145
~~~~~~~~~~~~~~~~~

doc/reference/tooling/tt_cli/connect.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,23 @@ username and the password:
7777

7878
* The ``-u`` (``--username``) and ``-p`` (``--password``) options:
7979

80-
.. code-block:: console
80+
.. code-block:: console
8181
82-
$ tt connect 192.168.10.10:3301 -u myuser -p p4$$w0rD
82+
$ tt connect 192.168.10.10:3301 -u myuser -p p4$$w0rD
8383
8484
* The connection string:
8585

86-
.. code-block:: console
86+
.. code-block:: console
8787
88-
$ tt connect myuser:p4$$w0rD@192.168.10.10:3301 -u myuser -p p4$$w0rD
88+
$ tt connect myuser:p4$$w0rD@192.168.10.10:3301
8989
90-
* Environment variables ``TT_CLI_USERNAME`` and ``TT_CLI_PASSWORD`` :
90+
* Environment variables ``TT_CLI_USERNAME`` and ``TT_CLI_PASSWORD``:
9191

92-
.. code-block:: console
92+
.. code-block:: console
9393
94-
$ export TT_CLI_USERNAME=myuser
95-
$ export TT_CLI_PASSWORD=p4$$w0rD
96-
$ tt connect 192.168.10.10:3301
94+
$ export TT_CLI_USERNAME=myuser
95+
$ export TT_CLI_PASSWORD=p4$$w0rD
96+
$ tt connect 192.168.10.10:3301
9797
9898
If no credentials are provided for a remote connection, the user is automatically ``guest``.
9999

doc/reference/tooling/tt_cli/install.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,39 @@ dependencies, such as a C compiler. Make sure they are available in the system.
7171

7272
Tarantool Enterprise Edition is installed from prebuilt packages.
7373

74+
.. _tt-install-authentication:
75+
76+
Authentication
77+
~~~~~~~~~~~~~~
78+
79+
To install Tarantool EE using ``tt install``, you need to provide access credentials
80+
for Tarantool customer zone. Use one of the following ways to pass the username and the password:
81+
82+
* A text file specified in the ``ee.credentials_path`` parameter of the
83+
:ref:`tt enviromnment configuration <tt-config_file>`:
84+
85+
.. code-block:: yaml
86+
87+
# tt.yaml
88+
# ...
89+
ee:
90+
credential_path: cred.txt
91+
92+
`cred.txt` should contain a username and a password on separate lines:
93+
94+
.. code-block:: text
95+
96+
myuser@tarantool.io
97+
p4$$w0rD
98+
99+
* Environment variables ``TT_CLI_EE_USERNAME`` and ``TT_CLI_EE_PASSWORD``:
100+
101+
.. code-block:: console
102+
103+
$ export TT_CLI_EE_USERNAME=myuser@tarantool.io
104+
$ export TT_CLI_EE_PASSWORD=p4$$w0rD
105+
$ tt install tarantool-ee
106+
74107
Development versions
75108
~~~~~~~~~~~~~~~~~~~~
76109

doc/reference/tooling/tt_cli/play.rst

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ A single call of ``tt play`` can play multiple files.
1414
Options
1515
-------
1616

17+
.. option:: -u USERNAME, --username USERNAME
18+
19+
A Tarantool user for connecting to the instance.
20+
21+
.. option:: -p PASSWORD, --password PASSWORD
22+
23+
The user's password.
24+
1725
.. option:: --from LSN
1826

1927
Play operations starting from the given LSN.
@@ -53,9 +61,35 @@ on this instance. This means that:
5361
by adding the ``--show-system`` flag. With this flag, ``tt`` plays the operations that
5462
create and configure user-defined spaces.
5563

56-
* The operations' LSNs will change unless you play all operations that took place since the instance startup.
64+
* The operations' LSNs change unless you play all operations that took place since the instance startup.
65+
66+
* Replica IDs change in accordance with the destination instance configuration.
67+
68+
Authentication
69+
~~~~~~~~~~~~~~
70+
71+
Use one of the following ways to pass the username and the password when connecting
72+
to the instance:
73+
74+
* The ``-u`` (``--username``) and ``-p`` (``--password``) options:
75+
76+
.. code-block:: console
5777
58-
* Replica IDs will change in accordance with the destination instance configuration.
78+
$ tt play 192.168.10.10:3301 00000000000000000000.xlog -u myuser -p p4$$w0rD
79+
80+
* The connection string:
81+
82+
.. code-block:: console
83+
84+
$ tt play myuser:p4$$w0rD@192.168.10.10:3301 00000000000000000000.xlog
85+
86+
* Environment variables ``TT_CLI_USERNAME`` and ``TT_CLI_PASSWORD``:
87+
88+
.. code-block:: console
89+
90+
$ export TT_CLI_USERNAME=myuser
91+
$ export TT_CLI_PASSWORD=p4$$w0rD
92+
$ tt play 192.168.10.10:3301 00000000000000000000.xlog
5993
6094
Examples
6195
--------

0 commit comments

Comments
 (0)