Projet

Général

Profil

Wiki » Historique » Version 37

Patrice Nadeau, 2014-08-19 21:01

1 13 Patrice Nadeau
%{font-size:18pt}Redmine%
2
3 30 Patrice Nadeau
> Merge du fichier PDF : issue:#13
4 25 Patrice Nadeau
5 13 Patrice Nadeau
---
6
7 1 Patrice Nadeau
{{toc}}
8
9 13 Patrice Nadeau
h1. Redmine
10 6 Patrice Nadeau
11 31 Patrice Nadeau
Logiciel de gestion de projets, sources, bugs et timeline.
12
Contient un module de Wiki, de fichiers.
13
Supporte aussi les systèmes de version de fichier (Git, SVN entre autre).
14
Disponible à http://www.redmine.org/projects/redmine/wiki/Download
15
16
De base, ne fonctionne pas avec Apache
17
Pour une solution possible, voir : http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Apache_to_run_Redmine
18
19
Sa principale difficulté d’installation et sa dépendance à Ruby. D’où le but de ce guide.
20
Voir aussi :
21
* http://bitnami.com/stack/redmine
22
* http://www.turnkeylinux.org/redmine
23
24 6 Patrice Nadeau
h1. Installation
25
26 32 Patrice Nadeau
Ce guide documente une installation GNU/Linux avec les version suivantes :
27
* openSUSE 13.1
28
* Redmine 2.4.2
29
30 1 Patrice Nadeau
h2. Prérequis
31
32 32 Patrice Nadeau
Un serveur LAMP openSUSE
33
34
Les logiciels suivants :
35
36
* libmysqlclient-devel
37
* mysql-community-server
38
* ruby-2.0
39
* ruby20-devel
40
* rubygem-bundler
41
* rubygem-mysql2
42
* rubygem-pg
43
* ImageMagick
44
* ImageMagick-devel
45
* git
46
* gcc
47
* make
48
49
h2. MySQL
50
51
Ajout au démarrage automatique et démarrage du service :
52
<pre><code class="bash">
53
chkconfig -a mysql
54
rcmysql start
55
</code></pre>
56
57
Création de la base de donnés.
58
Substituer les items suivants à votre choix :
59
* redmine : Usager pour la base de donnés.
60
* password : Mot de passe de la base de donnees.
61
* db : Nom de la base de donnés.
62
63
Lancer MySQL :
64
<pre><code class="bash">
65
mysql -u root -p
66
</code></pre>
67
68
Commandes MySQL :
69
<pre><code class="sql">
70
create database db character set utf8;
71
create user 'redmine'@'localhost' identified by 'password';
72
grant all privileges on db.* to 'redmine'@'localhost';
73
commit;
74
quit;
75
</code></pre>
76
77 33 Patrice Nadeau
h2. Redmine
78 13 Patrice Nadeau
79 33 Patrice Nadeau
L’installation sera faite dans _\srv\redmine_
80
<pre><code class="bash">
81
cd /srv/
82
svn co http://svn.redmine.org/redmine/branches/2.4-stable redmine
83
cd redmine
84
cp config/database.yml.example config/database.yml
85
cp config/configuration.yml.example config/configuration.yml
86
mkdir public/plugin_assets
87
</code></pre>
88
89
Si un usager MySQL autre que _root_ ou mot de passe diffèrent est utilisé :
90
Éditer le fichier *config/database.yml*, section *Production* et modifier les lignes :
91
* *username*
92
* *password*
93
94
Éditer le fichier _config/configuration.yml_ et modifier la configuration SMTP.
95
96
h2. Ruby
97
98 34 Patrice Nadeau
Installation des gems de Ruby
99 1 Patrice Nadeau
<pre><code class="bash">
100 34 Patrice Nadeau
cd redmine
101
gem install bundler
102
gem install activerecord-mysql2-adapter
103
bundle install --without development test
104 1 Patrice Nadeau
</code></pre>
105 34 Patrice Nadeau
106
h2. Initialisation
107
108
Création de la cryptographie, de la structure et des donnés de base :
109
<pre><code class="bash">
110
cd /srv/redmine
111
rake generate_secret_token
112
RAILS_ENV=production rake db:migrate
113
RAILS_ENV=production rake redmine:load_default_data
114
</code></pre>
115
116
Ouvrir dans le pare-feu :
117
* TCP : 3000
118
119
Lancer le serveur web (test)
120
<pre><code class="bash">
121
cd /srv/redmine
122
ruby script/rails server webrick -e production
123
</code></pre>
124
125
A partir d’un navigateur web, se brancher à http://server:3000.
126
Utiliser l’usager *admin* avec le mot de passe *admin*.
127
Vérifier la configuration dans *Administration*, *Information*.
128 16 Patrice Nadeau
129 35 Patrice Nadeau
h2. Transformation en daemon
130
131
Le script original vient de http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_openSUSE
132
Copier le script dans le fichier */etc/init.d/redmine*
133
134
Le modifier de la manière suivante :
135
* REDMINE_BIN=/srv/redmine/current/script/rails
136
* REDMINE_USER=user
137
* Corriger le «typo» à la ligne 73 : $REDMI-NE_BIN -> $REDMINE_BIN
138
* Dans la section stop, après la ligne killproc, ajouter *rm $PIDFILE*
139
140
Rendre le fichier exécutable, l’ajouter aux services SUSE et l’exécuter au démarrage :
141
<pre><code class="bash">
142
chmod 0755 /etc/init.d/redmine
143
cp -s /etc/init.d/redmine /usr/bin/rcredmine
144
chkconfig -a redmine
145
</code></pre>
146
147 29 Patrice Nadeau
h1. Personnalisation
148 8 Patrice Nadeau
149 36 Patrice Nadeau
h2. Ajout d’un logo
150
151
Les informations viennent de : http://www.redmine.org/projects/redmine/wiki/Howto_add_a_logo_to_your_Redmine_banner
152
153
Copier le logo dans _/srv/redmine/public/images/logo.png_
154 1 Patrice Nadeau
155 37 Patrice Nadeau
Modifier le fichier _/srv/redmine/app/views/layout/base.rhtml.erb_
156
* Ajouter la ligne 
157 1 Patrice Nadeau
<pre><code class="ruby">
158 37 Patrice Nadeau
<img src="<%= Redmine::Utils.relative_url_root %>/images/logo.png" style="top-margin: 15px; left-margin: 15px;"/>
159
</code></pre>
160
* Si on ne veux plus afficher le titre, mettre en commentaire :
161
<pre><code class="ruby">
162 1 Patrice Nadeau
<!--<h1><%= page_header_title %></h1>-->
163 37 Patrice Nadeau
</code></pre>
164
165
Redémarrer Redmine
166
<pre><code class="bash">
167
rcredmine restart
168 36 Patrice Nadeau
</code></pre>
169
170 1 Patrice Nadeau
h2. Plugins
171
172 4 Patrice Nadeau
h3. Redmine Rouge
173 12 Patrice Nadeau
174 1 Patrice Nadeau
Permet le support de langage supplémentaire pour l'affichage de la syntaxe d'un code source.
175 4 Patrice Nadeau
176 13 Patrice Nadeau
"Langage supporté":http://rouge.jayferd.us/demo
177 1 Patrice Nadeau
178
https://github.com/ngyuki/redmine_rouge
179
180
<pre>
181
<code class="bash">
182
cd /srv/redmine/plugins
183
git clone https://github.com/ngyuki/redmine_rouge.git
184
cd ..
185
bundle install
186 2 Patrice Nadeau
# Relancer redmine
187
rcredmine restart
188 1 Patrice Nadeau
</code>
189
</pre>
190 5 Patrice Nadeau
191 22 Patrice Nadeau
h3. Code Highlight
192 9 Patrice Nadeau
193 10 Patrice Nadeau
http://www.redmine.org/plugins/codehightlight_button
194 9 Patrice Nadeau
195
Bouton permettant de sélectionner du code et d'activer la syntaxe selon un langage.
196 11 Patrice Nadeau
>Ne fonctionne pas pour les langages supplémentaires supportées par le « plug-in » _Redmine Rouge_. Voir "ici":https://github.com/mediatainment/redmine_codebutton/issues/2
197 9 Patrice Nadeau
198 1 Patrice Nadeau
Installation
199
<pre><code class="bash">
200 10 Patrice Nadeau
cd /srv/redmine/plugins
201
git clone https://github.com/mediatainment/redmine_codebutton.git
202
cd ..
203
rake redmine:plugins
204 9 Patrice Nadeau
rake redmine:plugins:migrate RAILS_ENV=production
205 10 Patrice Nadeau
# Relancer Redmine
206 1 Patrice Nadeau
rcredmine restart
207
</code></pre>
208 11 Patrice Nadeau
209 23 Patrice Nadeau
h3. Redmine Issue Checklist
210 11 Patrice Nadeau
211
Extends issues to store checklist items
212
213
http://redminecrm.com/projects/checklist
214
215
Installation
216
<pre><code class="bash">
217
cd /srv/redmine/plugins
218
wget http://redminecrm.com/license_manager/4200/redmine_issue_checklist-2_0_5.zip
219
unzip redmine_issue_checklist-2_0_5.zip
220
bundle exec rake redmine:plugins NAME=redmine_issue_checklist RAILS_ENV=production
221
# Relancer Redmine
222
rcredmine restart
223
</code></pre>
224
225
Configuration
226
Dans *Administration*
227
* *Plugins*
228
** Choisir les options voulues
229
* *Roles and permissions*
230
** Choisir le rôle
231
Donner les droits voulus sur :
232
*** Done checklist items 
233
*** Edit checklist items 
234 14 Patrice Nadeau
*** View checklist
235 1 Patrice Nadeau
236 24 Patrice Nadeau
h3. Redmine People
237
238 29 Patrice Nadeau
> A faire
239 24 Patrice Nadeau
240 20 Patrice Nadeau
h3. WikiNG
241 1 Patrice Nadeau
242 20 Patrice Nadeau
Personnalisation des items dans le wiki.
243 28 Patrice Nadeau
Ajoute des boutons et des icônes comme FIXME et TODO.
244 29 Patrice Nadeau
> « Écrase » le bouton installé par _Code Highlight_
245 21 Patrice Nadeau
246
Installation
247 27 Patrice Nadeau
<pre><code class="bash">
248 26 Patrice Nadeau
cd /srv/redmine
249
wget http://projects.andriylesyuk.com/attachments/download/564/wiking-1.0.0b.tar.bz2
250
tar xvf wiking-1.0.0b.tar.bz2
251
mv wiking plugins
252
rake redmine:plugins:migrate RAILS_ENV=production
253
# restart Redmine
254
rcredmine restart
255
</code></pre>
256 20 Patrice Nadeau
257 14 Patrice Nadeau
h1. Mise à jour
258 1 Patrice Nadeau
259 14 Patrice Nadeau
S’assurer d'avoir les dernières versions des plugins.
260 9 Patrice Nadeau
261 14 Patrice Nadeau
h1. Copie de sécurité
262 5 Patrice Nadeau
263
<pre> <code class="bash">
264
#!/bin/bash
265
#
266
# backup_redmine.sh
267
# Backup of a Redmine setup
268
# Last Changes: 2013-02-23
269
# Maintainer: Patrice Nadeau  <patricen@telwarwick.net>
270
271
# TODO Verify the results (folder exist, enough disk pace , etc..)
272
273
## The only variable needed to be changed
274
# Directory of the Redmine install
275
declare -r RAIL_ROOT='/srv/redmine'
276
# MySQL database
277
declare -r MYSQL_DB=''
278
# MySQL username for the Redemine db
279
declare -r MYSQL_USER=''
280
# MySQL password for the Redemine db
281
declare -r MYSQL_PASSWORD=''
282
# Directory for the backup (must exist and with no space in the name)
283
declare -r DIR='/root'
284
## end
285
286
# Exit level
287
declare -ir EXIT_OK=0
288
declare -ir EXIT_WARNING=1
289
declare -ir EXIT_ERROR=2
290
291
declare -i STATUS=$EXIT_OK
292
293
# The directory inside the archive 
294
declare -r REDMINE='redmine'
295
TMP_DIR=$DIR/$REDMINE
296
297
# This will be used for the archive file 
298
declare -r DST=$DIR/redmine_$(date +%Y%m%d_%H%M%S).tar.gz
299
300
# The temporary sql file
301
declare -r TMP_MYSQL=$TMP_DIR/$MYSQL_DB.mysql
302
303
echo "Backup in progress in $DST"
304
305
#### Create the temp directory ####
306
mkdir $TMP_DIR
307
308
#### backup MySQL ####
309
if [ $STATUS -eq $EXIT_OK ] 
310
then
311
	STEP='Creating MySQL backup'
312
	mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD $MYSQL_DB \
313
		> $TMP_MYSQL
314
	STATUS=$?
315
fi
316
317
#### backup the Redmine folder ####
318
if [ $STATUS -eq $EXIT_OK ] 
319
then
320
	STEP='Creating Redmine'"'"' files backup'
321
	cp --recursive $RAIL_ROOT $TMP_DIR
322
	STATUS=$?
323
fi
324
325
#### create the archive file ####
326
if [ $STATUS -eq $EXIT_OK ] 
327
then
328
	STEP="Creating archive"
329
	tar --create --gzip --file $DST --directory=$DIR $REDMINE
330
	STATUS=$?
331
fi
332
333
#### cleanup ####
334
if [ $STATUS -eq $EXIT_OK ] 
335
then
336
	STEP='Cleaning up'
337
	rm --recursive --force $TMP_DIR
338
	STATUS=$?
339
fi
340
341
#### exit ####
342
if [ $STATUS -eq $EXIT_OK ] 
343
then
344
	echo "Backup done"
345
else
346
	echo "Bakup failed with error code $STATUS in step $STEP"
347
fi
348
349
350
exit $STATUS
351
352
</code></pre>