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