fix(docs): fixed cli usage docs

This commit is contained in:
RhodeCode Admin 2024-11-27 12:55:54 +01:00
parent f0d42a9cb2
commit a780ffc2fa

View file

@ -12,6 +12,26 @@ The commands available with |RCT| can be split into three categories:
- Local configuration commands used to help set up your |RCT| configuration.
.. _tools-rhodecode-list-instance:
rhodecode-list-instances
------------------------
Use this command to list the instance details configured in the
:file:`/etc/rhodecode/conf/.rhoderc` file.
.. code-block:: bash
$ ./rcstack cli cmd rhodecode-list-instances --config=/etc/rhodecode/conf/.rhoderc
[instance:production] - Config only
API-HOST: https://some.url.com
API-KEY: some.auth.token
[instance:development] - Config only
API-HOST: http://some.ip.address
API-KEY: some.auth.token
rhodecode-tools
---------------
@ -163,6 +183,7 @@ Example usage:
removing gist /home/brian/repos/.rc_gist_store/5
removing gist /home/brian/repos/.rc_gist_store/8FtCKdcbRKmEvRzTVsEt
rhodecode-cleanup-repos
-----------------------
@ -201,30 +222,37 @@ Example usage:
.. code-block:: bash
# Cleaning up repos using tools installed with RCE 350 and above
$ ~/.rccontrol/enterprise-4/profile/bin/rhodecode-cleanup-repos \
--instance-name=enterprise-4 --older-than=1d
Scanning for repositories in /home/brian/repos...
preparing to remove [2] found repositories older than 1 day, 0:00:00 (1d)
# create a .rhoderc file in your host config directory (in :file:`config/_shared/.rhoderc`):
[instance:rcstack-instance]
api_host = http://rhodecode:10020
api_key = <API_KEY>
repo_dir = /var/opt/rhodecode_repo_store
# Run rcstack cli
./rcstack cli cmd rhodecode-cleanup-repos --instance-name=rcstack-instance --config=/etc/rhodecode/conf/.rhoderc
checking if config files needs bootstrapping
Scanning for repositories in /var/opt/rhodecode_repo_store...
the following repositories will be deleted completely:
* REMOVED: 2015-08-05 00:23:18 | /home/brian/repos/rm__20150805_002318_831
* REMOVED: 2015-08-04 01:22:10 | /home/brian/repos/rm__20150804_012210_336
* REMOVED: 2015-08-05 00:23:18 | /var/opt/rhodecode_repo_store/rm__20150805_002318_831
* REMOVED: 2015-08-04 01:22:10 | /var/opt/rhodecode_repo_store/rm__20150804_012210_336
are you sure you want to remove them? [y/N]:
# Clean up repos older than 1 year
# If using virtualenv and pre RCE 350 tools installation
(venv)$ rhodecode-cleanup-repos --instance-name=enterprise-1 \
--older-than=365d
./rcstack cli cmd rhodecode-cleanup-repos --instance-name=rcstack-instance --config=/etc/rhodecode/conf/.rhoderc --older-than=365d
Scanning for repositories in /home/brian/repos...
checking if config files needs bootstrapping
Scanning for repositories in /var/opt/rhodecode_repo_store...
preparing to remove [343] found repositories older than 365 days
# clean up repos older than 3 days
# If using virtualenv and pre RCE 350 tools installation
(venv)$ rhodecode-cleanup-repos --instance-name=enterprise-1 \
--older-than=3d
Scanning for repositories in /home/brian/repos...
./rcstack cli cmd rhodecode-cleanup-repos --instance-name=rcstack-instance --config=/etc/rhodecode/conf/.rhoderc --older-than=3d
checking if config files needs bootstrapping
Scanning for repositories in /var/opt/rhodecode_repo_store...
preparing to remove [3] found repositories older than 3 days
.. _tools-config:
@ -420,9 +448,8 @@ Example usage:
}
# Cat a file and pipe to gist
# in RCE 3.5.0 tools and above
$ cat ~/.rhoderc | ~/.rccontrol/{instance-id}/profile/bin/rhodecode-gist \
--instance-name=enterprise-4 -d '.rhoderc copy' create
$ cat ~/.rhoderc | ./rcstack cli cmd rhodecode-gist --instance-name=rcstack-instance --config=/etc/rhodecode/conf/.rhoderc -d '.rhoderc copy' create
{
"error": null,
"id": 9253,
@ -512,41 +539,18 @@ Example usage:
.. code-block:: bash
# Run the indexer
$ ~/.rccontrol/enterprise-4/profile/bin/rhodecode-index \
--instance-name=enterprise-4
# Create the indexing mapping file
$ ./rcstack cli cmd rhodecode-index --instance-name=rcstack-instance --config=/etc/rhodecode/conf/.rhoderc --create-mapping search_mapping.ini
# Run indexer based on search_mapping.ini file
# This is using pre-350 virtualenv
(venv)$ rhodecode-index --instance-name=enterprise-1
# Run the indexer
$ ./rcstack cli cmd rhodecode-index --instance-name=rcstack-instance --config=/etc/rhodecode/conf/.rhoderc
# Run indexer based on search_mapping.ini file using rhodecode-tools virtualenv
(venv)$ rhodecode-index --instance-name=rcstack-instance
# Index from the command line without creating
# the .rhoderc file
$ rhodecode-index --apikey=key --apihost=http://rhodecode.server \
--instance-name=enterprise-2 --save-config
# Create the indexing mapping file
$ ~/.rccontrol/enterprise-4/profile/bin/rhodecode-index \
--create-mapping search_mapping.ini --instance-name=enterprise-4
.. _tools-rhodecode-list-instance:
rhodecode-list-instances
------------------------
Use this command to list the instance details configured in the
:file:`~/.rhoderc` file.
.. code-block:: bash
$ .rccontrol/enterprise-1/profile/bin/rhodecode-list-instances
[instance:production] - Config only
API-HOST: https://some.url.com
API-KEY: some.auth.token
[instance:development] - Config only
API-HOST: http://some.ip.address
API-KEY: some.auth.token
$ rhodecode-index --apikey=key --apihost=http://rhodecode.server --instance-name=rcstack-instance --save-config
.. _tools-setup-config: