##// END OF EJS Templates
docs: update dev setup instructions
lisaq -
r489:b044ae37 default
parent child Browse files
Show More
@@ -1,144 +1,152 b''
1 .. _dev-setup:
1 .. _dev-setup:
2
2
3 ===================
3 ===================
4 Development setup
4 Development setup
5 ===================
5 ===================
6
6
7
7
8 RhodeCode Enterprise runs inside a Nix managed environment. This ensures build
8 RhodeCode Enterprise runs inside a Nix managed environment. This ensures build
9 environment dependencies are correctly declared and installed during setup.
9 environment dependencies are correctly declared and installed during setup.
10 It also enables atomic upgrades, rollbacks, and multiple instances of RhodeCode
10 It also enables atomic upgrades, rollbacks, and multiple instances of RhodeCode
11 Enterprise running with isolation.
11 Enterprise running with isolation.
12
12
13 To set up RhodeCode Enterprise inside the Nix environment, use the following steps:
13 To set up RhodeCode Enterprise inside the Nix environment, use the following steps:
14
14
15
15
16
16
17 Setup Nix Package Manager
17 Setup Nix Package Manager
18 -------------------------
18 -------------------------
19
19
20 To install the Nix Package Manager, please run::
20 To install the Nix Package Manager, please run::
21
21
22 $ curl https://nixos.org/nix/install | sh
22 $ curl https://nixos.org/nix/install | sh
23
23
24 or go to https://nixos.org/nix/ and follow the installation instructions.
24 or go to https://nixos.org/nix/ and follow the installation instructions.
25 Once this is correctly set up on your system, you should be able to use the
25 Once this is correctly set up on your system, you should be able to use the
26 following commands:
26 following commands:
27
27
28 * `nix-env`
28 * `nix-env`
29
29
30 * `nix-shell`
30 * `nix-shell`
31
31
32
32
33 .. tip::
33 .. tip::
34
34
35 Update your channels frequently by running ``nix-channel --upgrade``.
35 Update your channels frequently by running ``nix-channel --upgrade``.
36
36
37
37
38 Switch nix to the latest STABLE channel
38 Switch nix to the latest STABLE channel
39 ---------------------------------------
39 ---------------------------------------
40
40
41 run::
41 run::
42
42
43 nix-channel --add https://nixos.org/channels/nixos-16.03 nixpkgs
43 nix-channel --add https://nixos.org/channels/nixos-16.03 nixpkgs
44
44
45 Followed by::
45 Followed by::
46
46
47 nix-channel --update
47 nix-channel --update
48
48
49
49
50 Clone the required repositories
50 Clone the required repositories
51 -------------------------------
51 -------------------------------
52
52
53 After Nix is set up, clone the RhodeCode Enterprise Community Edition and
53 After Nix is set up, clone the RhodeCode Enterprise Community Edition and
54 RhodeCode VCSServer repositories into the same directory.
54 RhodeCode VCSServer repositories into the same directory.
55 To do this, use the following example::
55 To do this, use the following example::
56
56
57 mkdir rhodecode-develop && cd rhodecode-develop
57 mkdir rhodecode-develop && cd rhodecode-develop
58 hg clone https://code.rhodecode.com/rhodecode-enterprise-ce
58 hg clone https://code.rhodecode.com/rhodecode-enterprise-ce
59 hg clone https://code.rhodecode.com/rhodecode-vcsserver
59 hg clone https://code.rhodecode.com/rhodecode-vcsserver
60
60
61 .. note::
61 .. note::
62
62
63 If you cannot clone the repository, please request read permissions
63 If you cannot clone the repository, please request read permissions
64 via support@rhodecode.com
64 via support@rhodecode.com
65
65
66
66
67
67
68 Enter the Development Shell
68 Enter the Development Shell
69 ---------------------------
69 ---------------------------
70
70
71 The final step is to start the development shell. To do this, run the
71 The final step is to start the development shell. To do this, run the
72 following command from inside the cloned repository::
72 following command from inside the cloned repository::
73
73
74 cd ~/rhodecode-enterprise-ce
74 cd ~/rhodecode-enterprise-ce
75 nix-shell
75 nix-shell
76
76
77 .. note::
77 .. note::
78
78
79 On the first run, this will take a while to download and optionally compile
79 On the first run, this will take a while to download and optionally compile
80 a few things. The following runs will be faster. The development shell works
80 a few things. The following runs will be faster. The development shell works
81 fine on MacOS and Linux platforms.
81 fine on both MacOS and Linux platforms.
82
82
83
83
84
84
85 Creating a Development Configuration
85 Creating a Development Configuration
86 ------------------------------------
86 ------------------------------------
87
87
88 To create a development environment for RhodeCode Enterprise,
88 To create a development environment for RhodeCode Enterprise,
89 use the following steps:
89 use the following steps:
90
90
91 1. Create a copy of `~/rhodecode-enterprise-ce/configs/development.ini`
91 1. Create a copy of `~/rhodecode-enterprise-ce/configs/development.ini`
92 2. Adjust the configuration settings to your needs
92 2. Adjust the configuration settings to your needs
93
93
94 .. note::
94 .. note::
95
95
96 It is recommended to use the name `dev.ini`.
96 It is recommended to use the name `dev.ini`.
97
97
98
98
99 Setup the Development Database
99 Setup the Development Database
100 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
101
101
102 To create a development database, use the following example. This is a one
102 To create a development database, use the following example. This is a one
103 time operation::
103 time operation::
104
104
105 paster setup-rhodecode dev.ini \
105 paster setup-rhodecode dev.ini \
106 --user=admin --password=secret \
106 --user=admin --password=secret \
107 --email=admin@example.com \
107 --email=admin@example.com \
108 --repos=~/my_dev_repos
108 --repos=~/my_dev_repos
109
109
110
110
111 Start the Development Server
111 Start the Development Server
112 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
112 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113
113
114 When starting the development server, you should start the vcsserver as a
114 First, set the `start.vcs_server` flag in the ``dev.ini`` file to true.
115 separate process. To do this, use one of the following examples:
115 For example:
116
117 1. Set the `start.vcs_server` flag in the ``dev.ini`` file to true. For example:
118
116
119 .. code-block:: python
117 .. code-block:: python
120
118
121 ### VCS CONFIG ###
119 ### VCS CONFIG ###
122 ##################
120 ##################
123 vcs.start_server = true
121 vcs.start_server = true
124 vcs.server = localhost:9900
122 vcs.server = localhost:9900
125 vcs.server.log_level = debug
123 vcs.server.log_level = debug
126
124
127 Then start the server using the following command: ``rcserver dev.ini``
125 From the rhodecode-vcsserver directory, start the development server in another
126 nix-shell, using the following command::
128
127
129 2. Start the development server using the following example::
128 pserve configs/development_pyramid.ini http_port=9900
130
129
131 rcserver --with-vcsserver dev.ini
130 In the adjacent nix-shell which you created for your development server, you may
131 now start CE with the following command::
132
132
133 3. Start the development server in a different terminal using the following
133 rcserver dev.ini
134 example::
135
134
136 vcsserver
135 You may also wish to use the option `--reload` with this command so that any
136 changes which you make in the code trigger an automatic refresh.
137
137
138
138
139 Run the Environment Tests
139 Run the Environment Tests
140 ^^^^^^^^^^^^^^^^^^^^^^^^^
140 ^^^^^^^^^^^^^^^^^^^^^^^^^
141
141
142 Please make sure that the tests are passing to verify that your environment is
142 Please make sure that the tests are passing to verify that your environment is
143 set up correctly. RhodeCode uses py.test to run tests.
143 set up correctly. RhodeCode uses py.test to run tests.
144 Please simply run ``make test`` to run the basic test suite.
144 While your instance is running, start a new nix-shell and simply run
145 ``make test`` to run the basic test suite.
146
147
148 Need Help?
149 ^^^^^^^^^^
150
151 Join us on Slack via https://rhodecode.com/join or post questions in our
152 Community Portal at https://community.rhodecode.com
General Comments 0
You need to be logged in to leave comments. Login now