Show More
@@ -0,0 +1,244 | |||
|
1 | .. _installation_win: | |
|
2 | ||
|
3 | ||
|
4 | Step by step Installation for Windows | |
|
5 | ===================================== | |
|
6 | ||
|
7 | ||
|
8 | RhodeCode step-by-step install Guide for Windows | |
|
9 | ||
|
10 | Target OS: Windows XP SP3 English (Clean installation) | |
|
11 | + All Windows Updates until 24-may-2012 | |
|
12 | ||
|
13 | Step1 - Install Visual Studio 2008 Express | |
|
14 | ------------------------------------------ | |
|
15 | ||
|
16 | ||
|
17 | Optional: You can also install MingW, but VS2008 installation is easier | |
|
18 | ||
|
19 | Download "Visual C++ 2008 Express Edition with SP1" from: | |
|
20 | http://www.microsoft.com/visualstudio/en-us/products/2008-editions/express | |
|
21 | (if not found or relocated, google for "visual studio 2008 express" for | |
|
22 | updated link) | |
|
23 | ||
|
24 | You can also download full ISO file for offline installation, just | |
|
25 | choose "All - Offline Install ISO image file" in the previous page and | |
|
26 | choose "Visual C++ 2008 Express" when installing. | |
|
27 | ||
|
28 | ||
|
29 | .. note:: | |
|
30 | ||
|
31 | Silverlight Runtime and SQL Server 2008 Express Edition are not | |
|
32 | required, you can uncheck them | |
|
33 | ||
|
34 | ||
|
35 | Step2 - Install Python | |
|
36 | ---------------------- | |
|
37 | ||
|
38 | Install Python 2.x.y (x >= 5) x86 version (32bit). DO NOT USE A 3.x version. | |
|
39 | Download Python 2.x.y from: | |
|
40 | http://www.python.org/download/ | |
|
41 | ||
|
42 | Choose "Windows Installer" (32bit version) not "Windows X86-64 | |
|
43 | Installer". While writing this guide, the latest version was v2.7.3. | |
|
44 | Remember the specific major and minor version installed, because it will | |
|
45 | be needed in the next step. In this case, it is "2.7". | |
|
46 | ||
|
47 | ||
|
48 | Step3 - Install Win32py extensions | |
|
49 | ---------------------------------- | |
|
50 | ||
|
51 | Download pywin32 from: | |
|
52 | http://sourceforge.net/projects/pywin32/files/ | |
|
53 | ||
|
54 | - Click on "pywin32" folder | |
|
55 | - Click on the first folder (in this case, Build 217, maybe newer when you try) | |
|
56 | - Choose the file ending with ".win32-py2.x.exe" -> x being the minor | |
|
57 | version of Python you installed (in this case, 7) | |
|
58 | When writing this guide, the file was: | |
|
59 | http://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/pywin32-217.win32-py2.7.exe/download | |
|
60 | ||
|
61 | ||
|
62 | Step4 - Python BIN | |
|
63 | ------------------ | |
|
64 | ||
|
65 | Add Python BIN folder to the path | |
|
66 | ||
|
67 | You have to add the Python folder to the path, you can do it manually | |
|
68 | (editing "PATH" environment variable) or using Windows Support Tools | |
|
69 | that came preinstalled in Vista/7 and can be installed in Windows XP. | |
|
70 | ||
|
71 | - Using support tools on WINDOWS XP: | |
|
72 | If you use Windows XP you can install them using Windows XP CD and | |
|
73 | navigating to \SUPPORT\TOOLS. There, execute Setup.EXE (not MSI). | |
|
74 | Afterwards, open a CMD and type:: | |
|
75 | ||
|
76 | SETX PATH "%PATH%;[your-python-path]" -M | |
|
77 | ||
|
78 | Close CMD (the path variable will be updated then) | |
|
79 | ||
|
80 | - Using support tools on WINDOWS Vista/7: | |
|
81 | ||
|
82 | Open a CMD and type:: | |
|
83 | ||
|
84 | SETX PATH "%PATH%;[your-python-path]" /M | |
|
85 | ||
|
86 | Please substitute [your-python-path] with your Python installation path. | |
|
87 | Typically: C:\\Python27 | |
|
88 | ||
|
89 | ||
|
90 | Step5 - RhodeCode folder structure | |
|
91 | ---------------------------------- | |
|
92 | ||
|
93 | Create a RhodeCode folder structure | |
|
94 | ||
|
95 | This is only a example to install RhodeCode, you can of course change | |
|
96 | it. However, this guide will follow the proposed structure, so please | |
|
97 | later adapt the paths if you change them. My recommendation is to use | |
|
98 | folders with NO SPACES. But you can try if you are brave... | |
|
99 | ||
|
100 | Create the following folder structure:: | |
|
101 | ||
|
102 | C:\RhodeCode | |
|
103 | C:\RhodeCode\Bin | |
|
104 | C:\RhodeCode\Env | |
|
105 | C:\RhodeCode\Repos | |
|
106 | ||
|
107 | ||
|
108 | Step6 - Install virtualenv | |
|
109 | --------------------------- | |
|
110 | ||
|
111 | Install Virtual Env for Python | |
|
112 | ||
|
113 | Navigate to: http://www.virtualenv.org/en/latest/index.html#installation | |
|
114 | Right click on "virtualenv.py" file and choose "Save link as...". | |
|
115 | Download to C:\\RhodeCode (or whatever you want) | |
|
116 | (the file is located at | |
|
117 | https://raw.github.com/pypa/virtualenv/master/virtualenv.py) | |
|
118 | ||
|
119 | Create a virtual Python environment in C:\\RhodeCode\\Env (or similar). To | |
|
120 | do so, open a CMD (Python Path should be included in Step3), navigate | |
|
121 | where you downloaded "virtualenv.py", and write:: | |
|
122 | ||
|
123 | python virtualenv.py C:\RhodeCode\Env | |
|
124 | ||
|
125 | (--no-site-packages is now the default behaviour of virtualenv, no need | |
|
126 | to include it) | |
|
127 | ||
|
128 | ||
|
129 | Step7 - Install RhodeCode | |
|
130 | ------------------------- | |
|
131 | ||
|
132 | Finally, install RhodeCode | |
|
133 | ||
|
134 | Close previously opened command prompt/s, and open a Visual Studio 2008 | |
|
135 | Command Prompt (**IMPORTANT!!**). To do so, go to Start Menu, and then open | |
|
136 | "Microsoft Visual C++ 2008 Express Edition" -> "Visual Studio Tools" -> | |
|
137 | "Visual Studio 2008 Command Prompt" | |
|
138 | ||
|
139 | In that CMD (loaded with VS2008 PATHs) type:: | |
|
140 | ||
|
141 | cd C:\RhodeCode\Env\Scripts (or similar) | |
|
142 | activate | |
|
143 | ||
|
144 | The prompt will change into "(Env) C:\\RhodeCode\\Env\\Scripts" or similar | |
|
145 | (depending of your folder structure). Then type:: | |
|
146 | ||
|
147 | pip install rhodecode | |
|
148 | ||
|
149 | (long step, please wait until fully complete) | |
|
150 | ||
|
151 | Some warnings will appear, don't worry as they are normal. | |
|
152 | ||
|
153 | ||
|
154 | Step8 - Configuring RhodeCode | |
|
155 | ----------------------------- | |
|
156 | ||
|
157 | ||
|
158 | steps taken from http://packages.python.org/RhodeCode/setup.html | |
|
159 | ||
|
160 | You have to use the same Visual Studio 2008 command prompt as Step7, so | |
|
161 | if you closed it reopen it following the same commands (including the | |
|
162 | "activate" one). When ready, just type:: | |
|
163 | ||
|
164 | cd C:\RhodeCode\Bin | |
|
165 | paster make-config RhodeCode production.ini | |
|
166 | ||
|
167 | Then, you must edit production.ini to fit your needs (ip address, ip | |
|
168 | port, mail settings, database, whatever). I recommend using NotePad++ | |
|
169 | (free) or similar text editor, as it handles well the EndOfLine | |
|
170 | character differences between Unix and Windows | |
|
171 | (http://notepad-plus-plus.org/) | |
|
172 | ||
|
173 | For the sake of simplicity lets run it with the default settings. After | |
|
174 | your edits (if any), in the previous Command Prompt, type:: | |
|
175 | ||
|
176 | paster setup-rhodecode production.ini | |
|
177 | ||
|
178 | (this time a NEW database will be installed, you must follow a different | |
|
179 | step to later UPGRADE to a newer RhodeCode version) | |
|
180 | ||
|
181 | The script will ask you for confirmation about creating a NEW database, | |
|
182 | answer yes (y) | |
|
183 | The script will ask you for repository path, answer C:\\RhodeCode\\Repos | |
|
184 | (or similar) | |
|
185 | The script will ask you for admin username and password, answer "admin" | |
|
186 | + "123456" (or whatever you want) | |
|
187 | The script will ask you for admin mail, answer "admin@xxxx.com" (or | |
|
188 | whatever you want) | |
|
189 | ||
|
190 | If you make some mistake and the script does not end, don't worry, start | |
|
191 | it again. | |
|
192 | ||
|
193 | ||
|
194 | Step9 - Running RhodeCode | |
|
195 | ------------------------- | |
|
196 | ||
|
197 | ||
|
198 | In the previous command prompt, being in the C:\\RhodeCode\\Bin folder, | |
|
199 | just type:: | |
|
200 | ||
|
201 | paster serve production.ini | |
|
202 | ||
|
203 | Open yout web server, and go to http://127.0.0.1:5000 | |
|
204 | ||
|
205 | It works!! :-) | |
|
206 | ||
|
207 | Remark: | |
|
208 | If it does not work first time, just Ctrl-C the CMD process and start it | |
|
209 | again. Don't forget the "http://" in Internet Explorer | |
|
210 | ||
|
211 | ||
|
212 | ||
|
213 | What this Guide does not cover: | |
|
214 | ||
|
215 | - Installing Celery | |
|
216 | - Running RhodeCode as Windows Service. You can investigate here: | |
|
217 | ||
|
218 | - http://pypi.python.org/pypi/wsgisvc | |
|
219 | - http://ryrobes.com/python/running-python-scripts-as-a-windows-service/ | |
|
220 | - http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service | |
|
221 | ||
|
222 | - Using Apache. You can investigate here: | |
|
223 | ||
|
224 | - https://groups.google.com/group/rhodecode/msg/c433074e813ffdc4 | |
|
225 | ||
|
226 | ||
|
227 | Upgrading | |
|
228 | ========= | |
|
229 | ||
|
230 | Stop running RhodeCode | |
|
231 | Open a CommandPrompt like in Step7 (VS2008 path + activate) and type:: | |
|
232 | ||
|
233 | easy_install -U rhodecode | |
|
234 | cd \RhodeCode\Bin | |
|
235 | ||
|
236 | { backup your production.ini file now} :: | |
|
237 | ||
|
238 | paster make-config RhodeCode production.ini | |
|
239 | ||
|
240 | (check changes and update your production.ini accordingly) :: | |
|
241 | ||
|
242 | paster upgrade-db production.ini (update database) | |
|
243 | ||
|
244 | Full steps in http://packages.python.org/RhodeCode/upgrade.html No newline at end of file |
@@ -29,9 +29,14 http://pypi.python.org/pypi/RhodeCode, d | |||
|
29 | 29 | |
|
30 | 30 | python setup.py install |
|
31 | 31 | |
|
32 | Step by step installation example for Windows | |
|
33 | --------------------------------------------- | |
|
32 | 34 | |
|
33 | Step by step installation example | |
|
34 | --------------------------------- | |
|
35 | :ref:`installation_win` | |
|
36 | ||
|
37 | ||
|
38 | Step by step installation example for Linux | |
|
39 | ------------------------------------------- | |
|
35 | 40 | |
|
36 | 41 | |
|
37 | 42 | For installing RhodeCode i highly recommend using separate virtualenv_. This |
@@ -34,6 +34,11 entering this "root" path ``setup-rhodec | |||
|
34 | 34 | and password for the initial admin account which ``setup-rhodecode`` sets |
|
35 | 35 | up for you. |
|
36 | 36 | |
|
37 | setup process can be fully automated, example for lazy:: | |
|
38 | ||
|
39 | paster setup-rhodecode production.ini --user=marcink --password=secret --email=marcin@rhodecode.org --repos=/home/marcink/my_repos | |
|
40 | ||
|
41 | ||
|
37 | 42 | - The ``setup-rhodecode`` command will create all of the needed tables and an |
|
38 | 43 | admin account. When choosing a root path you can either use a new empty |
|
39 | 44 | location, or a location which already contains existing repositories. If you |
@@ -286,7 +286,6 class DiffProcessor(object): | |||
|
286 | 286 | tag, |
|
287 | 287 | l['line'][last:] |
|
288 | 288 | ) |
|
289 | ||
|
290 | 289 | do(line) |
|
291 | 290 | do(next_) |
|
292 | 291 | |
@@ -298,9 +297,6 class DiffProcessor(object): | |||
|
298 | 297 | files = [] |
|
299 | 298 | try: |
|
300 | 299 | line = lineiter.next() |
|
301 | # skip first context | |
|
302 | skipfirst = True | |
|
303 | ||
|
304 | 300 | while 1: |
|
305 | 301 | # continue until we found the old file |
|
306 | 302 | if not line.startswith('--- '): |
@@ -322,7 +318,6 class DiffProcessor(object): | |||
|
322 | 318 | |
|
323 | 319 | line = lineiter.next() |
|
324 | 320 | while line: |
|
325 | ||
|
326 | 321 | match = self._chunk_re.match(line) |
|
327 | 322 | if not match: |
|
328 | 323 | break |
@@ -334,20 +329,20 class DiffProcessor(object): | |||
|
334 | 329 | [int(x or 1) for x in match.groups()[:-1]] |
|
335 | 330 | old_line -= 1 |
|
336 | 331 | new_line -= 1 |
|
337 |
|
|
|
332 | gr = match.groups() | |
|
333 | context = len(gr) == 5 | |
|
338 | 334 | old_end += old_line |
|
339 | 335 | new_end += new_line |
|
340 | 336 | |
|
341 | 337 | if context: |
|
342 |
|
|
|
338 | # skip context only if it's first line | |
|
339 | if int(gr[0]) > 1: | |
|
343 | 340 | lines.append({ |
|
344 | 341 | 'old_lineno': '...', |
|
345 | 342 | 'new_lineno': '...', |
|
346 | 343 | 'action': 'context', |
|
347 | 344 | 'line': line, |
|
348 | 345 | }) |
|
349 | else: | |
|
350 | skipfirst = False | |
|
351 | 346 | |
|
352 | 347 | line = lineiter.next() |
|
353 | 348 | while old_line < old_end or new_line < new_end: |
@@ -372,14 +367,24 class DiffProcessor(object): | |||
|
372 | 367 | affects_old = affects_new = True |
|
373 | 368 | action = 'unmod' |
|
374 | 369 | |
|
375 | old_line += affects_old | |
|
376 |
|
|
|
377 |
|
|
|
378 |
' |
|
|
379 |
' |
|
|
380 |
' |
|
|
381 |
|
|
|
382 | }) | |
|
370 | if line.find('No newline at end of file') != -1: | |
|
371 | lines.append({ | |
|
372 | 'old_lineno': '...', | |
|
373 | 'new_lineno': '...', | |
|
374 | 'action': 'context', | |
|
375 | 'line': line | |
|
376 | }) | |
|
377 | ||
|
378 | else: | |
|
379 | old_line += affects_old | |
|
380 | new_line += affects_new | |
|
381 | lines.append({ | |
|
382 | 'old_lineno': affects_old and old_line or '', | |
|
383 | 'new_lineno': affects_new and new_line or '', | |
|
384 | 'action': action, | |
|
385 | 'line': line | |
|
386 | }) | |
|
387 | ||
|
383 | 388 | line = lineiter.next() |
|
384 | 389 | except StopIteration: |
|
385 | 390 | pass |
@@ -393,7 +398,7 class DiffProcessor(object): | |||
|
393 | 398 | line = lineiter.next() |
|
394 | 399 | if line['action'] != 'unmod': |
|
395 | 400 | nextline = lineiter.next() |
|
396 |
if nextline['action'] |
|
|
401 | if nextline['action'] in ['unmod', 'context'] or \ | |
|
397 | 402 | nextline['action'] == line['action']: |
|
398 | 403 | continue |
|
399 | 404 | self.differ(line, nextline) |
General Comments 0
You need to be logged in to leave comments.
Login now