.. _rcc-cli: |RCC| CLI Guide =============== .. note:: The |RCC| command line is case sensitive. If you are running a Unix system without a source file, then you can use the |RCC| commands from the follow location: :file:`~/.rccontrol-profile/bin/rccontrol` .. _common-args-ref: Shell Autocomplete ------------------ rccontrol enables shell autocomplete integration. To enable autocomplete this is what you would need to put into your .bashrc: .. code-block:: bash eval "$(_RCCONTROL_COMPLETE=source rccontrol)" Common Options and Arguments ---------------------------- Unless specified, all ``rccontrol`` commands support the following options and arguments. These arguments are used to support custom configurations and non-standard setups: .. py:function:: rccontrol [command] [-v, --verbose] [-c, --config ] [-r, --profile ] [-I, --install-dir ] [--help] Common options and arguments applicable to all |RCC| commands. :argument -v: (Optional) Enables verbosity. :argument -c: (Optional) Location of :file:`.rccontrol.ini`. :argument -r: (Optional) Location of :file:`.rccontrol-profile`. :argument -I: (Optional) Location of application instances. :argument --help: (Optional) Display the command help message. .. code-block:: bash # Configure a custom Enterprise deployment $ rccontrol install Enterprise -c ./path/to/custom.ini -I /custom/location/ # Uninstall a custom Enterprise installation $ rccontrol uninstall Enterprise -I /custom/path/ -c ./path/to/.rrcontrol.ini rccontrol import ---------------- .. py:function:: rccontrol import [--version ] [--start-at-boot] [--self-managed-supervisor] [--offline] Imports your current |RCEE| installation, with all the required dependencies to being managed by |RCC|. This is necessary to be able to upgrade existing |RCEE| versions installed prior to 3.0.0. Once imported you can then use the ``rccontrol upgrade`` command to move to the latest |RCEE| version. This command takes the following options and arguments: :argument app: The options are **Community** or **Enterprise**. :argument ini_file: Imports the application using the given ``.ini`` file. :argument --version: (Optional) Imports a specified version of |RCEE| into |RCC|. :argument --start-at-boot: (Optional) Set the imported version of |RCEE| to start at boot. The default is ``yes``. :argument --self-managed-supervisor: (Optional) Allow customization of the supervisor settings for the imported version of |RCEE|. The default is for |RCC| to manage them and overwrite any custom changes. :argument --offline: (Optional) Uses the files in the local cache instead of downloading them. This is intended to be used in offline environments and by default is ``False``. This command takes :ref:`common-args-ref`. .. code-block:: bash # Import your current version using this command $ rccontrol import Enterprise /home/rhodecode/data/rhodecode.ini Parsing "rhodecode.ini": - host: 0.0.0.0 - port: 5000 - database: sqlite:////home/{user}/rhodecode/data/rhodecode.db?timeout=60 ... Installing RhodeCode Enterprise Configuring RhodeCode Enterprise ... Supervisord state is: RUNNING Added process group enterprise-1 rccontrol install ----------------- .. py:function:: rccontrol install [--version ] [--start-at-boot] [--self-managed-supervisor] [--offline] [--accept-license] Installs the specified RhodeCode application. It is possible to pass in JSON data to fill in some default arguments for installation. For example:: rccontrol install Community '{"email":"me@rhodecode.com", "username":"admin", "password":"secret", "host":"0.0.0.0", "repo_dir":"/path/to/repos"}' :argument app: The options are **Community**, **Enterprise** or **VCSServer**. :argument --version: (Optional) Set the targeted version otherwise default to the latest. :argument --start-at-boot: (Optional) Set the installed application to start at boot. The default is ``yes``. :argument --self-managed-supervisor: (Optional) Allow customization of the supervisor settings for the installed application. The default is for |RCC| to manage them and overwrite any custom changes. :argument --offline: (Optional) Uses the files in the local cache instead of downloading them. This is intended to be used in offline environments and by default is ``False``. :argument --accept-license: (Optional) Accept the current license for installer without asking for confirmation. rccontrol ishell ---------------- .. py:function:: rccontrol ishell Starts the specified application iShell interface. Only Enterprise or Community instances can start an iShell interface. :argument instance-id: Instance identifier. This command takes :ref:`common-args-ref`. .. code-block:: bash # Start ishell for this instance $ rccontrol ishell enterprise-1 rccontrol license ----------------- .. py:function:: rccontrol license Display license information. .. code-block:: bash $ rccontrol license Type: Default Expiry: Never Instances: Unlimited rccontrol restart ----------------- .. py:function:: rccontrol restart [--exact-match] Restarts the specified application instance. :argument instance-id: Instance identifier. :argument --exact-match: (Optional) Toggle regex based matching. The default is ``False``. This command takes :ref:`common-args-ref`. .. code-block:: bash # Restart the specified Enterprise instance $ rccontrol restart enterprise-1 # Restart the VCS Server $ rccontrol restart vcsserver-1 rccontrol self-destroy ---------------------- .. py:function:: rccontrol self-destroy [--force] Completely removes |RCC|, |RCEE|, and any |VCS| instances installed on your server. Together with any files that installer have created. It works like full uninstall command. :argument --force: (Optional) Don't ask for confirmation. The default is ``False``. .. note:: This command is not supported on Windows. Removal should be done trough the Add/Remove menu for more details, see :ref:`rcc-windows-ref` .. code-block:: bash # Completely remove all RhodeCode applications $ rccontrol self-destroy You are about to PERMANENTLY remove the following folders: /home/user/.rccontrol /home/user/.rccontrol-profile /home/user/.rccontrol.ini /opt/rhodecode/store /tmp/rccontrol.lock Additionally remove supervisord configs and fix shell Do you really want to continue? [y/N]: rccontrol self-init ------------------- .. py:function:: rccontrol self-init Initializes |RCC| and supervisord on your server. .. code-block:: bash # Start RhodeCode Control $ rccontrol self-init Supervisord state is: RUNNING rccontrol self-stop ------------------- .. py:function:: rccontrol self-stop [--force] Stops all instances and supervisord. With --force flag run an stop by killing all processes and supervisord. .. code-block:: bash # Stop RhodeCode Control $ rccontrol self-stop Sent stop signal to supervisord with PID:102245 Supervisord state is: STOPPED rccontrol self-update --------------------- .. py:function:: rccontrol self-update [] [--force] [--offline] Retrieves the latest version information and upgrades |RCC| to the newest available version. This command will fetch ``MANIFEST`` file from the RhodeCode servers which lists the available versions of |RCC|, |RCEE|, |RCCE| and |VCS|. :argument URL: (Optional) Replaces your :file:`/home/{user}/.rccontrol/{instance-id}/cache/MANIFEST` file with the one specified. The ``MANIFEST`` file controls what versions of software can be installed and should only be modified in special circumstances. :argument --force: (Optional) Ignores the version check to allow |RCC| to be replaced with the same version. This is useful to switch to a repacked release or attempt to repair your current installation. The default is ``False``. :argument --offline: (Optional) Avoids going online to fetch the latest ``MANIFEST`` file and/or copy of |RCC| instead using the files in the local cache. This overrides the ``URL`` argument and by default is ``False``. .. code-block:: bash $ rccontrol self-update Currently running RhodeCode Control "1.7.0" Downloading https://dl.rhodecode.com/linux/MANIFEST ... Latest version "1.8.0" Downloading https://dl.rhodecode.com/linux/RhodeCodeControl-1.8.0.tar.bz2 ... Extracting Control ... Successfully upgraded RhodeCode Control. Supervisord state is: RUNNING rccontrol start --------------- .. py:function:: rccontrol start [--exact-match] Starts the specified application instance. :argument instance-id: Instance identifier. :argument --exact-match: (Optional) Toggle regex based matching. The default is ``False``. This command takes :ref:`common-args-ref`. .. code-block:: bash # Start the specified Enterprise instance $ rccontrol start enterprise-1 # Start the specified VCS Server instance $ rccontrol start vcsserver-1 rccontrol status ---------------- .. py:function:: rccontrol status Displays the status of installed application instances. :argument instance-id: (Optional) Instance identifier. .. code-block:: bash # Display the status of installed applications $ rccontrol status - NAME: enterprise-1 - STATUS: STOPPED - TYPE: Enterprise - VERSION: 1.5.0 - URL: http://127.0.0.1:10000 - NAME: enterprise-2 - STATUS: STOPPED - TYPE: Enterprise - VERSION: 2.2.8 - URL: http://127.0.0.1:10001 - NAME: enterprise-3 - STATUS: RUNNING - TYPE: Enterprise - VERSION: 3.5.0 - VCS: vcsserver-1 - URL: http://127.0.0.1:10003 - NAME: vcsserver-1 - STATUS: RUNNING - TYPE: VCSServer - VERSION: 3.5.0 - URL: http://127.0.0.1:10002 rccontrol stop -------------- .. py:function:: rccontrol stop [--exact-match] Stops the specified application instance. :argument instance-id: Instance identifier. :argument --exact-match: (Optional) Toggle regex based matching. The default is ``False``. This command takes :ref:`common-args-ref`. .. code-block:: bash # Stops this instance $ rccontrol stop enterprise-1 rccontrol uninstall ------------------- .. py:function:: rccontrol uninstall [--exact-match] Uninstalls the specified application instance. :argument instance-id: Instance identifier. :argument --exact-match: (Optional) Toggle regex based matching. The default is ``True``. This command takes :ref:`common-args-ref`. .. code-block:: bash # Uninstall a specific instance $ rccontrol uninstall enterprise-1 rccontrol upgrade ----------------- .. py:function:: rccontrol upgrade [--version ] [--exact-match] [--force] [--offline] Upgrades the specified application instance. :argument instance-id: Instance identifier. :argument --version: (Optional) Set the targeted version otherwise default to the latest. :argument --exact-match: (Optional) Toggle regex based matching. The default is ``False``. :argument --force: (Optional) Ignores the version check to allow an instance to be replaced with the same version. This is useful to switch to a repacked release or attempt to repair the current installation. The default is ``False``. :argument --offline: (Optional) Uses the files in the local cache instead of downloading them. This is intended to be used in offline environments and by default is ``False``. This command takes :ref:`common-args-ref`. .. code-block:: bash # Upgrade to the latest version $ rccontrol upgrade vcsserver-1 # Upgrade to a specific version $ rccontrol upgrade enterprise-1 --version 3.5.0