##// END OF EJS Templates
settings: reduce number of settings fetch since it uses locking for cache invalidation and is generally slow....
settings: reduce number of settings fetch since it uses locking for cache invalidation and is generally slow. We anyway load it per-request so we can re-use this.

File last commit:

r3426:55112630 default
r3855:e1ec64bd default
Show More
dev-setup.rst
243 lines | 6.5 KiB | text/x-rst | RstLexer
docs: more comprehensive contributor docs #4039
r303 .. _dev-setup:
project: added all source files and assets
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
docs: improve contribution docs on how to run tests.
r272 Enterprise running with isolation.
project: added all source files and assets
r1
docs: updates to contributor documentation #4039
r271 To set up RhodeCode Enterprise inside the Nix environment, use the following steps:
project: added all source files and assets
r1
Setup Nix Package Manager
-------------------------
docs: updates to contributor documentation #4039
r271 To install the Nix Package Manager, please run::
project: added all source files and assets
r1
$ curl https://nixos.org/nix/install | sh
docs: updates to contributor documentation #4039
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
project: added all source files and assets
r1 following commands:
* `nix-env`
* `nix-shell`
.. tip::
docs: updated contribution and dev setup docs.
r1418 Update your channels frequently by running ``nix-channel --update``.
project: added all source files and assets
r1
docs: added info about how to remove nix from dev setup.
r2557 .. note::
To uninstall nix run the following:
remove the . "$HOME/.nix-profile/etc/profile.d/nix.sh" line in your ~/.profile or ~/.bash_profile
rm -rf $HOME/{.nix-channels,.nix-defexpr,.nix-profile,.config/nixpkgs}
sudo rm -rf /nix
project: added all source files and assets
r1
docs: updates to contributor documentation #4039
r271 Switch nix to the latest STABLE channel
---------------------------------------
project: added all source files and assets
r1
run::
nix: updated to 18.03 nix packages...
r2824 nix-channel --add https://nixos.org/channels/nixos-18.03 nixpkgs
project: added all source files and assets
r1
Followed by::
nix-channel --update
docs: updated dev setup
r3426 nix-env -i nix-2.0.4
project: added all source files and assets
r1
docs: improved contributor docs
r1215 Install required binaries
-------------------------
We need some handy tools first.
run::
nix-env -i nix-prefetch-hg
nix-env -i nix-prefetch-git
docs: added tip for faster nix-shell by pre-installing phantomJS
r3364 Speed up JS build by installing PhantomJS
-----------------------------------------
PhantomJS will be downloaded each time nix-shell is invoked. To speed this by
setting already downloaded version do this::
nix-env -i phantomjs-2.1.1
# and set nix bin path
export PATH=$PATH:~/.nix-profile/bin
project: added all source files and assets
r1 Clone the required repositories
-------------------------------
docs: updates to contributor documentation #4039
r271 After Nix is set up, clone the RhodeCode Enterprise Community Edition and
project: added all source files and assets
r1 RhodeCode VCSServer repositories into the same directory.
docs: updated contribution and dev setup docs.
r1418 RhodeCode currently is using Mercurial Version Control System, please make sure
you have it installed before continuing.
docs: fix for contribution docs.
r1847 To obtain the required sources, use the following commands::
project: added all source files and assets
r1
mkdir rhodecode-develop && cd rhodecode-develop
docs: updated dev setup
r3426 hg clone -u default https://code.rhodecode.com/rhodecode-enterprise-ce
hg clone -u default https://code.rhodecode.com/rhodecode-vcsserver
project: added all source files and assets
r1
.. note::
docs: updated contribution and dev setup docs.
r1418 If you cannot clone the repository, please contact us via support@rhodecode.com
project: added all source files and assets
r1
docs: improved contributor docs
r1215 Install some required libraries
-------------------------------
docs: fix for contribution docs.
r1847 There are some required drivers and dev libraries that we need to install to
test RhodeCode under different types of databases. For example in Ubuntu we
need to install the following.
docs: improved contributor docs
r1215
required libraries::
docs: updated dev setup
r3426 # svn related
docs: improved contributor docs
r1215 sudo apt-get install libapr1-dev libaprutil1-dev
sudo apt-get install libsvn-dev
docs: updated dev setup
r3426 # libcurl required too
sudo apt-get install libcurl4-openssl-dev
# mysql/pg server for development, optional
docs: improved contributor docs
r1215 sudo apt-get install mysql-server libmysqlclient-dev
sudo apt-get install postgresql postgresql-contrib libpq-dev
docs: updated dev setup
r3426
docs: improved contributor docs
r1215
project: added all source files and assets
r1
Enter the Development Shell
---------------------------
docs: updated contribution and dev setup docs.
r1418 The final step is to start the development shells. To do this, run the
project: added all source files and assets
r1 following command from inside the cloned repository::
docs: updated dev setup
r3426 # first, the vcsserver
docs: updated contribution and dev setup docs.
r1418 cd ~/rhodecode-vcsserver
nix-shell
# then enterprise sources
project: added all source files and assets
r1 cd ~/rhodecode-enterprise-ce
docs: updates to contributor documentation #4039
r271 nix-shell
project: added all source files and assets
r1
.. note::
On the first run, this will take a while to download and optionally compile
docs: improve contribution docs on how to run tests.
r272 a few things. The following runs will be faster. The development shell works
docs: update dev setup instructions
r489 fine on both MacOS and Linux platforms.
project: added all source files and assets
r1
docs: dev-setup add info about config.nix required for tests.
r1561 Create config.nix for development
---------------------------------
In order to run proper tests and setup linking across projects, a config.nix
file needs to be setup::
# create config
mkdir -p ~/.nixpkgs
touch ~/.nixpkgs/config.nix
# put the below content into the ~/.nixpkgs/config.nix file
# adjusts, the path to where you cloned your repositories.
{
rc = {
sources = {
rhodecode-vcsserver = "/home/dev/rhodecode-vcsserver";
rhodecode-enterprise-ce = "/home/dev/rhodecode-enterprise-ce";
rhodecode-enterprise-ee = "/home/dev/rhodecode-enterprise-ee";
};
};
}
project: added all source files and assets
r1
Creating a Development Configuration
------------------------------------
To create a development environment for RhodeCode Enterprise,
use the following steps:
docs: updated contribution and dev setup docs.
r1418 1. Create a copy of vcsserver config:
`cp ~/rhodecode-vcsserver/configs/development.ini ~/rhodecode-vcsserver/configs/dev.ini`
2. Create a copy of rhodocode config:
`cp ~/rhodecode-enterprise-ce/configs/development.ini ~/rhodecode-enterprise-ce/configs/dev.ini`
3. Adjust the configuration settings to your needs if needed.
project: added all source files and assets
r1
docs: updating vcsserver commands and development.ini defaults
r491 .. note::
project: added all source files and assets
r1
docs: updated contribution and dev setup docs.
r1418 It is recommended to use the name `dev.ini` since it's included in .hgignore file.
project: added all source files and assets
r1
Setup the Development Database
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docs: updates to contributor documentation #4039
r271 To create a development database, use the following example. This is a one
docs: updated contribution and dev setup docs.
r1418 time operation executed from the nix-shell of rhodecode-enterprise-ce sources ::
project: added all source files and assets
r1
docs: updated old commands not longer available starting from 4.11
r2628 rc-setup-app dev.ini \
project: added all source files and assets
r1 --user=admin --password=secret \
--email=admin@example.com \
--repos=~/my_dev_repos
docs: adding frontend compile instructions to dev setup
r490 Compile CSS and JavaScript
^^^^^^^^^^^^^^^^^^^^^^^^^^
docs: mention working with frontend using grunt and polymer
r701 To use the application's frontend and prepare it for production deployment,
you will need to compile the CSS and JavaScript with Grunt.
This is easily done from within the nix-shell using the following command::
docs: updated dev setup
r3426 make web-build
docs: adding frontend compile instructions to dev setup
r490
docs: mention working with frontend using grunt and polymer
r701 When developing new features you will need to recompile following any
changes made to the CSS or JavaScript files when developing the code::
docs: adding frontend compile instructions to dev setup
r490
docs: mention working with frontend using grunt and polymer
r701 grunt watch
docs: adding frontend compile instructions to dev setup
r490
docs: mention working with frontend using grunt and polymer
r701 This prepares the development (with comments/whitespace) versions of files.
docs: adding frontend compile instructions to dev setup
r490
docs: updated contribution and dev setup docs.
r1418 Start the Development Servers
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
project: added all source files and assets
r1
docs: update dev setup instructions
r489 From the rhodecode-vcsserver directory, start the development server in another
nix-shell, using the following command::
project: added all source files and assets
r1
docs: updated contribution and dev setup docs.
r1418 pserve configs/dev.ini
project: added all source files and assets
r1
docs: update dev setup instructions
r489 In the adjacent nix-shell which you created for your development server, you may
now start CE with the following command::
project: added all source files and assets
r1
docs: updating vcsserver commands and development.ini defaults
r491
docs: updated contribution and dev setup docs.
r1418 pserve --reload configs/dev.ini
project: added all source files and assets
r1
docs: updating vcsserver commands and development.ini defaults
r491 .. note::
docs: updated contribution and dev setup docs.
r1418 `--reload` flag will automatically reload the server when source file changes.
project: added all source files and assets
r1
Run the Environment Tests
^^^^^^^^^^^^^^^^^^^^^^^^^
docs: updates to contributor documentation #4039
r271 Please make sure that the tests are passing to verify that your environment is
docs: improve contribution docs on how to run tests.
r272 set up correctly. RhodeCode uses py.test to run tests.
docs: update dev setup instructions
r489 While your instance is running, start a new nix-shell and simply run
``make test`` to run the basic test suite.
Need Help?
^^^^^^^^^^
Join us on Slack via https://rhodecode.com/join or post questions in our
Community Portal at https://community.rhodecode.com