##// END OF EJS Templates
docs: prepare for having a stable development branch
Mads Kiilerich -
r4989:8927a1ac default
parent child Browse files
Show More
@@ -1,209 +1,209 b''
1 1 .. _installation:
2 2
3 3 ==========================
4 4 Installation on Unix/Linux
5 5 ==========================
6 6
7 7 **Kallithea** is written entirely in Python_ and requires Python version
8 8 2.6 or higher. Python 3.x is currently not supported.
9 9
10 10 There are several ways to install Kallithea:
11 11
12 12 - :ref:`installation-source`: The Kallithea development repository is stable
13 13 and can be used in production. In fact, the Kallithea maintainers do
14 14 use it in production. The advantage of installation from source and regularly
15 15 updating it is that you take advantage of the most recent improvements, which
16 16 is particularly useful because Kallithea is evolving rapidly.
17 17
18 18 - :ref:`installation-virtualenv`: If you prefer to only use released versions
19 19 of Kallithea, the recommended method is to install Kallithea in a virtual
20 20 Python environment using `virtualenv`. The advantages of this method over
21 21 direct installation is that Kallithea and its dependencies are completely
22 22 contained inside the virtualenv (which also means you can have multiple
23 23 installations side by side or remove it entirely by just removing the
24 24 virtualenv directory) and does not require root privileges.
25 25
26 26 - :ref:`installation-without-virtualenv`: The alternative method of installing
27 27 a Kallithea release is using standard pip. The package will be installed in
28 28 the same location as all other Python packages you have ever installed. As a
29 29 result, removing it is not as straightforward as with a virtualenv, as you'd
30 30 have to remove its dependencies manually and make sure that they are not
31 31 needed by other packages.
32 32
33 33 .. _installation-source:
34 34
35 35 Installation from repository source
36 36 -----------------------------------
37 37
38 To install Kallithea from source in a virtualenv, follow the instructions
39 below::
38 To install Kallithea in a virtualenv using the stable branch of the development
39 repository, follow the instructions below::
40 40
41 hg clone https://kallithea-scm.org/repos/kallithea
41 hg clone https://kallithea-scm.org/repos/kallithea -u stable
42 42 cd kallithea
43 43 virtualenv ../kallithea-venv
44 44 source ../kallithea-venv/bin/activate
45 45 python setup.py develop
46 46 python setup.py compile_catalog # for translation of the UI
47 47
48 48 You can now proceed to :ref:`setup`.
49 49
50 50 To upgrade, simply update the repository with ``hg pull -u`` and restart the
51 51 server.
52 52
53 53 .. _installation-virtualenv:
54 54
55 55 Installing a released version in a virtualenv
56 56 ---------------------------------------------
57 57
58 58 It is highly recommended to use a separate virtualenv_ for installing Kallithea.
59 59 This way, all libraries required by Kallithea will be installed separately from your
60 60 main Python installation and other applications and things will be less
61 61 problematic when upgrading the system or Kallithea.
62 62 An additional benefit of virtualenv_ is that it doesn't require root privileges.
63 63
64 64 - Assuming you have installed virtualenv_, create a new virtual environment
65 65 for example, in `/srv/kallithea/venv`, using the virtualenv command::
66 66
67 67 virtualenv /srv/kallithea/venv
68 68
69 69 - Activate the virtualenv_ in your current shell session by running::
70 70
71 71 source /srv/kallithea/venv/bin/activate
72 72
73 73 .. note:: You can't use UNIX ``sudo`` to source the ``virtualenv`` script; it
74 74 will "activate" a shell that terminates immediately. It is also perfectly
75 75 acceptable (and desirable) to create a virtualenv as a normal user.
76 76
77 77 - Make a folder for Kallithea data files, and configuration somewhere on the
78 78 filesystem. For example::
79 79
80 80 mkdir /srv/kallithea
81 81
82 82 - Go into the created directory and run this command to install Kallithea::
83 83
84 84 pip install kallithea
85 85
86 86 Alternatively, download a .tar.gz from http://pypi.python.org/pypi/Kallithea,
87 87 extract it and run::
88 88
89 89 python setup.py install
90 90
91 91 - This will install Kallithea together with pylons_ and all other required
92 92 python libraries into the activated virtualenv.
93 93
94 94 You can now proceed to :ref:`setup`.
95 95
96 96 .. _installation-without-virtualenv:
97 97
98 98 Installing a released version without virtualenv
99 99 ------------------------------------------------
100 100
101 101 For installation without virtualenv, 'just' use::
102 102
103 103 pip install kallithea
104 104
105 105 Note that this method requires root privileges and will install packages
106 106 globally without using the system's package manager.
107 107
108 108 To install as a regular user in ``~/.local``, you can use::
109 109
110 110 pip install --user kallithea
111 111
112 112 You can now proceed to :ref:`setup`.
113 113
114 114 Upgrading Kallithea from Python Package Index (PyPI)
115 115 -----------------------------------------------------
116 116
117 117 .. note::
118 118 It is strongly recommended that you **always** perform a database and
119 119 configuration backup before doing an upgrade.
120 120
121 121 These directions will use '{version}' to note that this is the version of
122 122 Kallithea that these files were used with. If backing up your Kallithea
123 123 instance from version 0.1 to 0.2, the ``my.ini`` file could be
124 124 backed up to ``my.ini.0-1``.
125 125
126 126
127 127 If using a SQLite database, stop the Kallithea process/daemon/service, and
128 128 then make a copy of the database file::
129 129
130 130 service kallithea stop
131 131 cp kallithea.db kallithea.db.{version}
132 132
133 133
134 134 Back up your configuration file::
135 135
136 136 cp my.ini my.ini.{version}
137 137
138 138
139 139 Ensure that you are using the Python virtual environment that you originally
140 140 installed Kallithea in by running::
141 141
142 142 pip freeze
143 143
144 144 This will list all packages installed in the current environment. If
145 145 Kallithea isn't listed, activate the correct virtual environment::
146 146
147 147 source /srv/kallithea/venv/bin/activate
148 148
149 149
150 150 Once you have verified the environment you can upgrade Kallithea with::
151 151
152 152 pip install --upgrade kallithea
153 153
154 154
155 155 Then run the following command from the installation directory::
156 156
157 157 paster make-config Kallithea my.ini
158 158
159 159 This will display any changes made by the new version of Kallithea to your
160 160 current configuration. It will try to perform an automerge. It is recommended
161 161 that you recheck the content after the automerge.
162 162
163 163 .. note::
164 164 Please always make sure your .ini files are up to date. Errors can
165 165 often be caused by missing parameters added in new versions.
166 166
167 167
168 168 It is also recommended that you rebuild the whoosh index after upgrading since
169 169 the new whoosh version could introduce some incompatible index changes. Please
170 170 read the changelog to see if there were any changes to whoosh.
171 171
172 172
173 173 The final step is to upgrade the database. To do this simply run::
174 174
175 175 paster upgrade-db my.ini
176 176
177 177 This will upgrade the schema and update some of the defaults in the database,
178 178 and will always recheck the settings of the application, if there are no new
179 179 options that need to be set.
180 180
181 181
182 182 .. note::
183 183 The DB schema upgrade library has some limitations and can sometimes fail if you try to
184 184 upgrade from older major releases. In such a case simply run upgrades sequentially, e.g.,
185 185 upgrading from 0.1.X to 0.3.X should be done like this: 0.1.X. > 0.2.X > 0.3.X
186 186 You can always specify what version of Kallithea you want to install for example in pip
187 187 `pip install Kallithea==0.2`
188 188
189 189 You may find it helpful to clear out your log file so that new errors are
190 190 readily apparent::
191 191
192 192 echo > kallithea.log
193 193
194 194 Once that is complete, you may now start your upgraded Kallithea Instance::
195 195
196 196 service kallithea start
197 197
198 198 Or::
199 199
200 200 paster serve /srv/kallithea/my.ini
201 201
202 202 .. note::
203 203 If you're using Celery, make sure you restart all instances of it after
204 204 upgrade.
205 205
206 206
207 207 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
208 208 .. _Python: http://www.python.org/
209 209 .. _pylons: http://www.pylonsproject.org/
General Comments 0
You need to be logged in to leave comments. Login now