RhodeCode Installation and Setup ================================ RhodeCode is an open soruce git hosting solution written in Python. Linaro uses its own RhodeCode instance to server git repositories. Installation ============ TL;DR ----- There is a script that can automate all the installation and setup process: * Download the 'rhodecode-config' branch from git.linaro.org * Move into the 'rhodecode-config' directory * Modify the file 'config/production.ini' changing at least the PostreSQL password at the following line: sqlalchemy.db1.url = postgresql://rhodecode:XXXX@localhost/rhodecode * Run the following command inserting the correct values: python scritps/rhodecode-setup --rhodecode-config config/production.ini \ --rhodecode-admin-email $EMAIL --rhodecode-admin-pwd $ADMIN_PWD --assume-yes \ --rabbitmq-pwd $PWD --postgres-role-pwd $PWD The above command will install all the necessary depencencies and setup RhodeCode with the default provided values. At the end, the script will print all the installation details. Dependencies ------------ * apache2 * build-essential * git-core * mercurial (v2.4.1, not in Ubuntu repositories, need to install via pip) * pgadmin3 * postgresql-9.1 * postgresql-server-dev-9.1 * python * python-babel * python-bcrypt * python-celery * python-dateutil * python-dev * python-docutils * python-formencode * python-markdown * python-nose * python-pastescript * python-pip * python-psycopg2 * python-pylons * python-webhelpers * python-webob * rabbitmq-server * waitress (v0.8.1, not in Ubuntu repositories, need to install via pip) The package git-core can also be installed via the Ubuntu Git Maintainers PPA that usually has more updated versions of git. The PPA is: ppa:git-core/ppa Users Configuration ------------------- The RhodeCode installation will be done with a dedicated system user and group. * System user: rhodecode * Group: rhodecode * Home: /home/rhodecode Necessary Directories --------------------- The following directories need to be writable at least by the 'rhodecode' user and/or group: * /var/log/celery * /var/log/rhodecode * /opt/rhodecode * /opt/git_repos The '/opt/rhodecode' directory is where RhodeCode will store its local data and caches. The '/opt/git_repos' directory is where RhodeCode will store the git repositories directories. PostgreSQL Configuration ------------------------ For PostgreSQL it is necessary to create a role called 'rhodecode' with its own password and the permit to create databases, and a database always called 'rhodecode'. Once this is done, modify the file 'config/production.ini' at the line: sqlalchemy.db1.url = postgresql://rhodecode:XXXX@localhost/rhodecode with the correct values. The default config file assumes PostreSQL to be installed on the same host of RhodeCode. Celery and RabbitMQ ------------------- For better performance with more than 10 repositories hosted on RhodeCode, it is recommended to use Celery with RabbitMQ. Once RabbitMQ has been installed, it is necessary to set up the correct user and vhost. Commands have to be run as root. * Add a new user called 'rhodecode' to RabbitMQ, set up its own password: rabbitmqctl add_user rhodecode $PASSWORD * Create a new RabbitMQ vhost called 'rhodecode-vhost': rabbitmqctl add_vhost rhodecode-vhost * Set the correct permission to the new user for the created vhost: rabbitmqctl set_permissions -p rhodecode-vhost rhodecode ".*" ".*" ".*" Once RabbitMQ has been configured, modify the file 'config/production.ini' with the correct values. The lines to modify are: broker.vhost = rhodecode-vhost broker.user = rhodecode broker.password = XXXX The default config file assumes RabbitMQ to be installed on the same host of RhodeCode. == Clone Rhodecode from git == git clone git://github.com/marcinkuzminski/rhodecode.git cd rhodecode && git checkout v1.5.1 == Install Rhodecode == python setup.py install = Setup rhodecode = #Get our configuration from git repository instructions should go here. == Start Rhodecode == paster serve production.ini