Adding Custom Packages¶
If you wish to make additional Python modules available to use with extensions that you have developed, use the following information.
Prerequisite¶
RhodeCode Control manages the RhodeCode Enterprise environment using Supervisor. To add custom packages
you need to install your instance of RhodeCode Enterprise as a self managed
instance. This will let you to update the PYTHONPATH
without RhodeCode Control
overwriting it. You can then extend the PYTHONPATH
to find packaged
outside of the RhodeCode Control managed environment. To install RhodeCode Enterprise as a self-managed
service using RhodeCode Control, see the
Self-managed Instructions.
Adding Custom Packages¶
Once you have your instance configured as self-managed, use the following steps.
- Add the modules to the RhodeCode Enterprise instance directory,
/home/user/.rccontrol/instance-id
. - Add this location to your
PYTHONPATH
environment variable. This is set in the/home/user/.rccontrol/supervisor/supervisor.ini
file. For more information aboutPYTHONPATH
, see the PYTHONPATH documentation.
[program:enterprise-1_script]
numprocs = 1
redirect_stderr = true
environment = PYTHONPATH="",GIT_SSL_CAINFO="/home/user/.rccontrol-profile/etc/ca-bundle.crt"
- Specify the hook for your added module on the
python:rcextensions/you.custom.hook
page. For
example, - Restart RhodeCode Enterprise using the
rccontrol restart <instance-id>
command. For more information, see the RhodeCode Control CLI documentation.