Projet

Général

Profil

Redmine » Historique » Version 16

Matthieu Herrb, 09/11/2017 10:55
+git_hosting

1 1 Laurent GUERBY
{{>toc}}
2 1 Laurent GUERBY
3 1 Laurent GUERBY
h1. Redmine
4 1 Laurent GUERBY
5 7 Mehdi Abaakouk
La machine chiliproject contient:
6 7 Mehdi Abaakouk
7 7 Mehdi Abaakouk
 - une base données postgres
8 7 Mehdi Abaakouk
 - une application installé dans /srv/http/redmine
9 7 Mehdi Abaakouk
 - le git de git.tetaneutral.net dans /srv/http/repositories
10 7 Mehdi Abaakouk
11 1 Laurent GUERBY
h2. Liens
12 1 Laurent GUERBY
13 1 Laurent GUERBY
* https://wiki.ldn-fai.net/wiki/Redmine#Par_mail ouvrir un ticket redmine par mail
14 10 Mehdi Abaakouk
* https://github.com/sileht/redmine-stupid-captcha - simple captcha pour tetaneutral.net
15 16 Matthieu Herrb
* https://github.com/jbox-web/redmine_git_hosting - le plugin git_hosting
16 2 Mehdi Abaakouk
17 6 Mehdi Abaakouk
h2. Upgrade
18 6 Mehdi Abaakouk
19 14 Mehdi Abaakouk
Example d'upgrade de 3.3.0 vers 3.3.2:
20 14 Mehdi Abaakouk
<pre>
21 14 Mehdi Abaakouk
# /etc/init.d/apache2 stop
22 14 Mehdi Abaakouk
# su - postgres
23 14 Mehdi Abaakouk
# pg_dump redmine > redmine-3.3.X-20170126.sql
24 14 Mehdi Abaakouk
# exit
25 14 Mehdi Abaakouk
26 14 Mehdi Abaakouk
# cd /srv/http/redmine
27 14 Mehdi Abaakouk
# git fetch --all
28 14 Mehdi Abaakouk
# git pull --rebase origin/3.3-stable
29 14 Mehdi Abaakouk
30 14 Mehdi Abaakouk
# cd plugins/redmine_git_hosting
31 14 Mehdi Abaakouk
# git stash   # remets redcap dans les gems
32 14 Mehdi Abaakouk
# git fetch --all
33 14 Mehdi Abaakouk
# git tag | tail
34 14 Mehdi Abaakouk
1.2.0
35 14 Mehdi Abaakouk
1.2.1
36 14 Mehdi Abaakouk
1.2.2
37 14 Mehdi Abaakouk
# git checkout 1.2.2
38 14 Mehdi Abaakouk
# git stash pop  # re-enleve redcap dans les gems
39 14 Mehdi Abaakouk
40 14 Mehdi Abaakouk
# cd ..plugins/redmine_bootstrap_kit
41 14 Mehdi Abaakouk
# git fetch --all
42 14 Mehdi Abaakouk
# git tag | tail
43 14 Mehdi Abaakouk
0.2.4
44 14 Mehdi Abaakouk
0.2.5
45 14 Mehdi Abaakouk
# git checkout 0.2.5
46 14 Mehdi Abaakouk
47 14 Mehdi Abaakouk
# cd ..plugins/redmine_startpage
48 14 Mehdi Abaakouk
# git pull --rebase   # Ce project n'a que une branch master
49 14 Mehdi Abaakouk
50 14 Mehdi Abaakouk
# cd ..plugins/redmine_revision_diff
51 14 Mehdi Abaakouk
# git fetch --all
52 14 Mehdi Abaakouk
# git tag | tail
53 14 Mehdi Abaakouk
v0.1.1
54 14 Mehdi Abaakouk
v0.1.2
55 14 Mehdi Abaakouk
# git checkout v0.1.2
56 14 Mehdi Abaakouk
57 14 Mehdi Abaakouk
# cd /srv/http/redmine
58 14 Mehdi Abaakouk
# bundle update
59 14 Mehdi Abaakouk
# gem cleanup  # ignorer les erreurs
60 14 Mehdi Abaakouk
# bundle update
61 14 Mehdi Abaakouk
# bundle exec rake db:migrate RAILS_ENV=production
62 14 Mehdi Abaakouk
# bundle exec rake redmine:plugins:migrate RAILS_ENV=production
63 14 Mehdi Abaakouk
# bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production
64 14 Mehdi Abaakouk
65 14 Mehdi Abaakouk
</pre>
66 14 Mehdi Abaakouk
67 6 Mehdi Abaakouk
Example d'upgrade de 3.1.X vers 3.3.X:
68 1 Laurent GUERBY
69 13 Mehdi Abaakouk
<pre>
70 6 Mehdi Abaakouk
# /etc/init.d/apache2 stop
71 6 Mehdi Abaakouk
# su - postgres
72 11 Mehdi Abaakouk
# pg_dump redmine > redmine-3.1.X-20160623.sql
73 1 Laurent GUERBY
# exit
74 1 Laurent GUERBY
#
75 12 Mehdi Abaakouk
# cd /srv/http/redmine
76 13 Mehdi Abaakouk
# git fetch --all
77 1 Laurent GUERBY
78 12 Mehdi Abaakouk
## For minor upgrade
79 13 Mehdi Abaakouk
# git pull --rebase origin/3.1-stable
80 13 Mehdi Abaakouk
81 12 Mehdi Abaakouk
## For major upgrade
82 12 Mehdi Abaakouk
# git checkout origin/3.3-stable -b ttnn/3.3
83 13 Mehdi Abaakouk
# git log origin/3.1-stable..ttnn/3.1 --pretty='%h - %s'
84 12 Mehdi Abaakouk
# git cherry-pick ... # pour chaque commit custom de ttnn listé précédement
85 9 Mehdi Abaakouk
86 12 Mehdi Abaakouk
# # Checkout plugins version compatible with redmine 3.3.X
87 12 Mehdi Abaakouk
88 1 Laurent GUERBY
# cd plugins/redmine_git_hosting
89 9 Mehdi Abaakouk
# git fetch --all
90 9 Mehdi Abaakouk
# git checkout 1.2.1
91 12 Mehdi Abaakouk
# vi Gemfile
92 12 Mehdi Abaakouk
### comment redcap gem
93 6 Mehdi Abaakouk
# cd plugins/redmine_bootstrap_kit
94 6 Mehdi Abaakouk
# git fetch --all
95 1 Laurent GUERBY
# git checkout 0.2.4
96 1 Laurent GUERBY
# cd /srv/http/redmine
97 1 Laurent GUERBY
98 14 Mehdi Abaakouk
# bundle update
99 14 Mehdi Abaakouk
# gem cleanup  # ignorer les erreurs
100 14 Mehdi Abaakouk
# bundle update
101 6 Mehdi Abaakouk
# bundle exec rake generate_secret_token
102 6 Mehdi Abaakouk
# bundle exec rake db:migrate RAILS_ENV=production
103 6 Mehdi Abaakouk
# bundle exec rake redmine:plugins:migrate RAILS_ENV=production
104 9 Mehdi Abaakouk
# bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production
105 8 Mehdi Abaakouk
</pre>
106 2 Mehdi Abaakouk
107 2 Mehdi Abaakouk
h2. Investigation Erreur 500
108 2 Mehdi Abaakouk
109 5 Laurent GUERBY
http://lists.tetaneutral.net/pipermail/technique/2014-May/001335.html
110 5 Laurent GUERBY
111 2 Mehdi Abaakouk
Erreur dans /srv/http/redmine/log/production.log:
112 2 Mehdi Abaakouk
113 2 Mehdi Abaakouk
<pre>
114 2 Mehdi Abaakouk
Completed 500 Internal Server Error in 23.2ms
115 2 Mehdi Abaakouk
116 2 Mehdi Abaakouk
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "wiki_content_versions_pkey"
117 2 Mehdi Abaakouk
DETAIL:  Key (id)=(164) already exists.
118 2 Mehdi Abaakouk
: INSERT INTO "wiki_content_versions" ("author_id", "comments", "compression", "data", "page_id", "updated_on", "version", "wiki_content_id") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"):
119 2 Mehdi Abaakouk
</pre>
120 2 Mehdi Abaakouk
121 2 Mehdi Abaakouk
<pre>
122 2 Mehdi Abaakouk
# su - postgres
123 2 Mehdi Abaakouk
# psql redmine
124 3 Mehdi Abaakouk
# select max(id) from wiki_content_versions;
125 4 Mehdi Abaakouk
max  
126 4 Mehdi Abaakouk
------
127 4 Mehdi Abaakouk
 6193
128 4 Mehdi Abaakouk
(1 row)
129 3 Mehdi Abaakouk
# alter sequence wiki_content_versions_id_seq start 6194;
130 3 Mehdi Abaakouk
# alter sequence wiki_content_versions_id_seq restart;
131 2 Mehdi Abaakouk
</pre>