Projet

Général

Profil

Wiki » Historique » Version 36

Patrice Nadeau, 2014-08-19 20:58

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
Modifier le fichier _/srv/redmine/app/views/layout/base.rhtml.erb_
155
156
Si on ne veux plus afficher le titre, mettre en commentaire :
157
<pre><code class="ruby">
158
<!--<h1><%= page_header_title %></h1>-->
159
</code></pre>
160
161 1 Patrice Nadeau
h2. Plugins
162
163 4 Patrice Nadeau
h3. Redmine Rouge
164 12 Patrice Nadeau
165 1 Patrice Nadeau
Permet le support de langage supplémentaire pour l'affichage de la syntaxe d'un code source.
166 4 Patrice Nadeau
167 13 Patrice Nadeau
"Langage supporté":http://rouge.jayferd.us/demo
168 1 Patrice Nadeau
169
https://github.com/ngyuki/redmine_rouge
170
171
<pre>
172
<code class="bash">
173
cd /srv/redmine/plugins
174
git clone https://github.com/ngyuki/redmine_rouge.git
175
cd ..
176
bundle install
177 2 Patrice Nadeau
# Relancer redmine
178
rcredmine restart
179 1 Patrice Nadeau
</code>
180
</pre>
181 5 Patrice Nadeau
182 22 Patrice Nadeau
h3. Code Highlight
183 9 Patrice Nadeau
184 10 Patrice Nadeau
http://www.redmine.org/plugins/codehightlight_button
185 9 Patrice Nadeau
186
Bouton permettant de sélectionner du code et d'activer la syntaxe selon un langage.
187 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
188 9 Patrice Nadeau
189 1 Patrice Nadeau
Installation
190
<pre><code class="bash">
191 10 Patrice Nadeau
cd /srv/redmine/plugins
192
git clone https://github.com/mediatainment/redmine_codebutton.git
193
cd ..
194
rake redmine:plugins
195 9 Patrice Nadeau
rake redmine:plugins:migrate RAILS_ENV=production
196 10 Patrice Nadeau
# Relancer Redmine
197 1 Patrice Nadeau
rcredmine restart
198
</code></pre>
199 11 Patrice Nadeau
200 23 Patrice Nadeau
h3. Redmine Issue Checklist
201 11 Patrice Nadeau
202
Extends issues to store checklist items
203
204
http://redminecrm.com/projects/checklist
205
206
Installation
207
<pre><code class="bash">
208
cd /srv/redmine/plugins
209
wget http://redminecrm.com/license_manager/4200/redmine_issue_checklist-2_0_5.zip
210
unzip redmine_issue_checklist-2_0_5.zip
211
bundle exec rake redmine:plugins NAME=redmine_issue_checklist RAILS_ENV=production
212
# Relancer Redmine
213
rcredmine restart
214
</code></pre>
215
216
Configuration
217
Dans *Administration*
218
* *Plugins*
219
** Choisir les options voulues
220
* *Roles and permissions*
221
** Choisir le rôle
222
Donner les droits voulus sur :
223
*** Done checklist items 
224
*** Edit checklist items 
225 14 Patrice Nadeau
*** View checklist
226 1 Patrice Nadeau
227 24 Patrice Nadeau
h3. Redmine People
228
229 29 Patrice Nadeau
> A faire
230 24 Patrice Nadeau
231 20 Patrice Nadeau
h3. WikiNG
232 1 Patrice Nadeau
233 20 Patrice Nadeau
Personnalisation des items dans le wiki.
234 28 Patrice Nadeau
Ajoute des boutons et des icônes comme FIXME et TODO.
235 29 Patrice Nadeau
> « Écrase » le bouton installé par _Code Highlight_
236 21 Patrice Nadeau
237
Installation
238 27 Patrice Nadeau
<pre><code class="bash">
239 26 Patrice Nadeau
cd /srv/redmine
240
wget http://projects.andriylesyuk.com/attachments/download/564/wiking-1.0.0b.tar.bz2
241
tar xvf wiking-1.0.0b.tar.bz2
242
mv wiking plugins
243
rake redmine:plugins:migrate RAILS_ENV=production
244
# restart Redmine
245
rcredmine restart
246
</code></pre>
247 20 Patrice Nadeau
248 14 Patrice Nadeau
h1. Mise à jour
249 1 Patrice Nadeau
250 14 Patrice Nadeau
S’assurer d'avoir les dernières versions des plugins.
251 9 Patrice Nadeau
252 14 Patrice Nadeau
h1. Copie de sécurité
253 5 Patrice Nadeau
254
<pre> <code class="bash">
255
#!/bin/bash
256
#
257
# backup_redmine.sh
258
# Backup of a Redmine setup
259
# Last Changes: 2013-02-23
260
# Maintainer: Patrice Nadeau  <patricen@telwarwick.net>
261
262
# TODO Verify the results (folder exist, enough disk pace , etc..)
263
264
## The only variable needed to be changed
265
# Directory of the Redmine install
266
declare -r RAIL_ROOT='/srv/redmine'
267
# MySQL database
268
declare -r MYSQL_DB=''
269
# MySQL username for the Redemine db
270
declare -r MYSQL_USER=''
271
# MySQL password for the Redemine db
272
declare -r MYSQL_PASSWORD=''
273
# Directory for the backup (must exist and with no space in the name)
274
declare -r DIR='/root'
275
## end
276
277
# Exit level
278
declare -ir EXIT_OK=0
279
declare -ir EXIT_WARNING=1
280
declare -ir EXIT_ERROR=2
281
282
declare -i STATUS=$EXIT_OK
283
284
# The directory inside the archive 
285
declare -r REDMINE='redmine'
286
TMP_DIR=$DIR/$REDMINE
287
288
# This will be used for the archive file 
289
declare -r DST=$DIR/redmine_$(date +%Y%m%d_%H%M%S).tar.gz
290
291
# The temporary sql file
292
declare -r TMP_MYSQL=$TMP_DIR/$MYSQL_DB.mysql
293
294
echo "Backup in progress in $DST"
295
296
#### Create the temp directory ####
297
mkdir $TMP_DIR
298
299
#### backup MySQL ####
300
if [ $STATUS -eq $EXIT_OK ] 
301
then
302
	STEP='Creating MySQL backup'
303
	mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD $MYSQL_DB \
304
		> $TMP_MYSQL
305
	STATUS=$?
306
fi
307
308
#### backup the Redmine folder ####
309
if [ $STATUS -eq $EXIT_OK ] 
310
then
311
	STEP='Creating Redmine'"'"' files backup'
312
	cp --recursive $RAIL_ROOT $TMP_DIR
313
	STATUS=$?
314
fi
315
316
#### create the archive file ####
317
if [ $STATUS -eq $EXIT_OK ] 
318
then
319
	STEP="Creating archive"
320
	tar --create --gzip --file $DST --directory=$DIR $REDMINE
321
	STATUS=$?
322
fi
323
324
#### cleanup ####
325
if [ $STATUS -eq $EXIT_OK ] 
326
then
327
	STEP='Cleaning up'
328
	rm --recursive --force $TMP_DIR
329
	STATUS=$?
330
fi
331
332
#### exit ####
333
if [ $STATUS -eq $EXIT_OK ] 
334
then
335
	echo "Backup done"
336
else
337
	echo "Bakup failed with error code $STATUS in step $STEP"
338
fi
339
340
341
exit $STATUS
342
343
</code></pre>