dev-setup.rst
144 lines
| 3.6 KiB
| text/x-rst
|
RstLexer
r303 | .. _dev-setup: | |||
r1 | ||||
=================== | ||||
Development setup | ||||
=================== | ||||
RhodeCode Enterprise runs inside a Nix managed environment. This ensures build | ||||
environment dependencies are correctly declared and installed during setup. | ||||
It also enables atomic upgrades, rollbacks, and multiple instances of RhodeCode | ||||
r272 | Enterprise running with isolation. | |||
r1 | ||||
r271 | To set up RhodeCode Enterprise inside the Nix environment, use the following steps: | |||
r1 | ||||
Setup Nix Package Manager | ||||
------------------------- | ||||
r271 | To install the Nix Package Manager, please run:: | |||
r1 | ||||
$ curl https://nixos.org/nix/install | sh | ||||
r271 | or go to https://nixos.org/nix/ and follow the installation instructions. | |||
Once this is correctly set up on your system, you should be able to use the | ||||
r1 | following commands: | |||
* `nix-env` | ||||
* `nix-shell` | ||||
.. tip:: | ||||
Update your channels frequently by running ``nix-channel --upgrade``. | ||||
r271 | Switch nix to the latest STABLE channel | |||
--------------------------------------- | ||||
r1 | ||||
run:: | ||||
nix-channel --add https://nixos.org/channels/nixos-16.03 nixpkgs | ||||
Followed by:: | ||||
nix-channel --update | ||||
Clone the required repositories | ||||
------------------------------- | ||||
r271 | After Nix is set up, clone the RhodeCode Enterprise Community Edition and | |||
r1 | RhodeCode VCSServer repositories into the same directory. | |||
To do this, use the following example:: | ||||
mkdir rhodecode-develop && cd rhodecode-develop | ||||
hg clone https://code.rhodecode.com/rhodecode-enterprise-ce | ||||
hg clone https://code.rhodecode.com/rhodecode-vcsserver | ||||
.. note:: | ||||
r272 | If you cannot clone the repository, please request read permissions | |||
via support@rhodecode.com | ||||
r1 | ||||
Enter the Development Shell | ||||
--------------------------- | ||||
r271 | The final step is to start the development shell. To do this, run the | |||
r1 | following command from inside the cloned repository:: | |||
cd ~/rhodecode-enterprise-ce | ||||
r271 | nix-shell | |||
r1 | ||||
.. note:: | ||||
On the first run, this will take a while to download and optionally compile | ||||
r272 | a few things. The following runs will be faster. The development shell works | |||
fine on MacOS and Linux platforms. | ||||
r1 | ||||
Creating a Development Configuration | ||||
------------------------------------ | ||||
To create a development environment for RhodeCode Enterprise, | ||||
use the following steps: | ||||
1. Create a copy of `~/rhodecode-enterprise-ce/configs/development.ini` | ||||
2. Adjust the configuration settings to your needs | ||||
.. note:: | ||||
r271 | It is recommended to use the name `dev.ini`. | |||
r1 | ||||
Setup the Development Database | ||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||||
r271 | To create a development database, use the following example. This is a one | |||
r1 | time operation:: | |||
paster setup-rhodecode dev.ini \ | ||||
--user=admin --password=secret \ | ||||
--email=admin@example.com \ | ||||
--repos=~/my_dev_repos | ||||
Start the Development Server | ||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||||
When starting the development server, you should start the vcsserver as a | ||||
r271 | separate process. To do this, use one of the following examples: | |||
r1 | ||||
1. Set the `start.vcs_server` flag in the ``dev.ini`` file to true. For example: | ||||
.. code-block:: python | ||||
### VCS CONFIG ### | ||||
################## | ||||
vcs.start_server = true | ||||
vcs.server = localhost:9900 | ||||
vcs.server.log_level = debug | ||||
Then start the server using the following command: ``rcserver dev.ini`` | ||||
2. Start the development server using the following example:: | ||||
rcserver --with-vcsserver dev.ini | ||||
3. Start the development server in a different terminal using the following | ||||
example:: | ||||
vcsserver | ||||
Run the Environment Tests | ||||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||||
r271 | Please make sure that the tests are passing to verify that your environment is | |||
r272 | set up correctly. RhodeCode uses py.test to run tests. | |||
Please simply run ``make test`` to run the basic test suite. | ||||