Projet

Général

Profil

Migrer-un-projet-EOLE-24-vers-Envole-4 » Historique » Version 4

Daniel Dehennin, 20/02/2015 11:24

1 1 Daniel Dehennin
{{toc}}
2 1 Daniel Dehennin
3 2 Daniel Dehennin
h1. Migrer un projet EOLE 2.4 vers Envole 4
4 2 Daniel Dehennin
5 1 Daniel Dehennin
{{include(envole:Intro-PreparationEnvole4)}}
6 1 Daniel Dehennin
7 3 Daniel Dehennin
8 3 Daniel Dehennin
9 3 Daniel Dehennin
h2. Vérifier que le paquet est bien compilé en EOLE 2.4
10 3 Daniel Dehennin
11 4 Daniel Dehennin
12 4 Daniel Dehennin
Vous pouvez savoir si un paquet a été compilé pour EOLE 2.4 avec la commande suivante :
13 4 Daniel Dehennin
14 4 Daniel Dehennin
<pre>
15 4 Daniel Dehennin
user@work:~src/project$ git ls-remote -t dev-eole pkg/eole/eole-2.4/*
16 4 Daniel Dehennin
11ac580a42785b81b279b6626a0f528680024f5f        refs/tags/pkg/eole/eole-2.4/1.9.7e-eole1-1
17 4 Daniel Dehennin
429d5062f2c07c63d1caa5ab8902ab6c7ed4db4a        refs/tags/pkg/eole/eole-2.4/1.9.7e-eole1-1^{}
18 4 Daniel Dehennin
0f812b21f2f66c7ae6938ac6a0a11a32b3f3fef3        refs/tags/pkg/eole/eole-2.4/1.9.7e-eole1-2
19 4 Daniel Dehennin
19159bd57ba0234765379cc56d88dffb31c3ef29        refs/tags/pkg/eole/eole-2.4/1.9.7e-eole1-2^{}
20 4 Daniel Dehennin
7195e46b8c8e03cab9d22dfc742dac5efce50dca        refs/tags/pkg/eole/eole-2.4/1.9.7e-eole2-1
21 4 Daniel Dehennin
53caa5cde42a6e38464262551a66a4b5385efe0b        refs/tags/pkg/eole/eole-2.4/1.9.7e-eole2-1^{}
22 4 Daniel Dehennin
</pre>
23 4 Daniel Dehennin
24 1 Daniel Dehennin
[[MigrationAppliEnvole4#État-des-lieux-application-par-application|La plupart des préparatifs ont déjà été fait]].
25 1 Daniel Dehennin
26 1 Daniel Dehennin
Il faut migrer certains éléments pour l’utilisation des "dépôts Envole":http://eole.ac-dijon.fr/envole.
27 1 Daniel Dehennin
28 1 Daniel Dehennin
*@ATTENTION@* : Assurez-vous que les branches soient bien à jour par rapport aux dépôts sur *@dev-eole.ac-dijon.fr@*.
29 1 Daniel Dehennin
30 1 Daniel Dehennin
31 1 Daniel Dehennin
32 2 Daniel Dehennin
h2. Dupliquer la branche de compilation EOLE 2.3 en branche de compilation Envole 4
33 1 Daniel Dehennin
34 1 Daniel Dehennin
<pre>
35 1 Daniel Dehennin
user@work:~/src/wordpress (master)$ git checkout -b dist/envole/4/master dist/ubuntu/precise/master
36 1 Daniel Dehennin
37 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master)$ git push -u $(git config branch.master.remote) dist/envole/4/master
38 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ 
39 1 Daniel Dehennin
</pre>
40 1 Daniel Dehennin
41 1 Daniel Dehennin
42 1 Daniel Dehennin
43 2 Daniel Dehennin
h2. Renommer l’étiquette de la dernière compilation EOLE 2.4
44 1 Daniel Dehennin
45 1 Daniel Dehennin
Les "étiquettes":http://git-scm.com/book/fr/Les-bases-de-Git-Étiquetage de la forme *@pkg/*@* sont positionnées sur la branche d’empaquetage afin de pouvoir suivre les demandes de compilation.
46 1 Daniel Dehennin
47 1 Daniel Dehennin
48 2 Daniel Dehennin
h3. Déterminer l’étiquette de la dernière compilation EOLE 2.4
49 1 Daniel Dehennin
50 1 Daniel Dehennin
<pre>
51 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ git describe --abbrev=0 dist/ubuntu/precise/master
52 1 Daniel Dehennin
pkg/eole/eole-2.4/3.6.1-eole3-1
53 1 Daniel Dehennin
54 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ EOLE_TAG=$(git describe --abbrev=0 dist/ubuntu/precise/master)
55 1 Daniel Dehennin
</pre>
56 1 Daniel Dehennin
57 2 Daniel Dehennin
h3. Extraire la version
58 1 Daniel Dehennin
59 1 Daniel Dehennin
<pre>
60 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ echo ${EOLE_TAG##*/}
61 1 Daniel Dehennin
3.6.1-eole3-1
62 1 Daniel Dehennin
63 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ VERSION=${EOLE_TAG##*/}
64 1 Daniel Dehennin
</pre>
65 1 Daniel Dehennin
66 2 Daniel Dehennin
h3. Vérifier le message de l’étiquette
67 1 Daniel Dehennin
68 1 Daniel Dehennin
Nous allons réutiliser le message de l’étiquette de la dernière compilation EOLE 2.4, la première ligne non vide doit contenir la chaîne *@New package version@* :
69 1 Daniel Dehennin
70 1 Daniel Dehennin
<pre>
71 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ git show -s --format="format:" ${EOLE_TAG} | perl -lane 'print if (/New package version/ .. /^-+BEGIN/) =~ /^\d+$/'
72 1 Daniel Dehennin
Lionel MORIN: New package version 3.6.1-eole3-1 for eole-2.4-unstable.
73 1 Daniel Dehennin
[...]
74 1 Daniel Dehennin
75 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ EOLE_MESSAGE=$(git show -s --format="format:" ${EOLE_TAG} | perl -lane 'print if (/New package version/ .. /^-+BEGIN/) =~ /^\d+$/')
76 1 Daniel Dehennin
</pre>
77 1 Daniel Dehennin
78 2 Daniel Dehennin
h3. Dupliquer l’étiquette de la dernière compilation EOLE 2.4 en première étiquette de compilation Envole
79 1 Daniel Dehennin
80 1 Daniel Dehennin
* Créer l’"étiquette":http://git-scm.com/book/fr/Les-bases-de-Git-Étiquetage
81 1 Daniel Dehennin
<pre>
82 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ git tag -m "${EOLE_MESSAGE}" pkg/envole/envole-4/${VERSION} ${EOLE_TAG}^{}
83 1 Daniel Dehennin
</pre>
84 1 Daniel Dehennin
* Vérifier le message de l’"étiquette":http://git-scm.com/book/fr/Les-bases-de-Git-Étiquetage
85 1 Daniel Dehennin
<pre>
86 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ git show pkg/envole/envole-4/${VERSION}
87 1 Daniel Dehennin
</pre>
88 1 Daniel Dehennin
89 2 Daniel Dehennin
h3. Pousser la nouvelle étiquette 
90 1 Daniel Dehennin
91 1 Daniel Dehennin
<pre>
92 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ git push --tags
93 1 Daniel Dehennin
</pre>
94 1 Daniel Dehennin
95 2 Daniel Dehennin
h2. Renommé l’étiquette du dernier paquet EOLE 2.4
96 1 Daniel Dehennin
97 1 Daniel Dehennin
Une étiquette de la forme *@debian/*@* est créé par l’infrastructure de compilation de paquet afin de gérer automatiquement le fichier *@debian/changelog@*.
98 1 Daniel Dehennin
99 1 Daniel Dehennin
100 2 Daniel Dehennin
h3. Déterminer l’étiquette du dernier paquet EOLE 2.4
101 1 Daniel Dehennin
102 1 Daniel Dehennin
<pre>
103 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ awk -F'=' '/^debian-tag/ {print $2}' debian/gbp.conf | sed -e "s,%(version)s,${VERSION},"
104 1 Daniel Dehennin
 debian/eole/2.4/3.6.1-eole3-1
105 1 Daniel Dehennin
106 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ EOLE_DEB_TAG=$(echo $(awk -F'=' '/^debian-tag/ {print $2}' debian/gbp.conf | sed -e "s,%(version)s,${VERSION},"))
107 1 Daniel Dehennin
</pre>
108 1 Daniel Dehennin
109 1 Daniel Dehennin
110 2 Daniel Dehennin
h3. Récupérer l’étiquette du dernier paquet EOLE 2.4
111 1 Daniel Dehennin
112 1 Daniel Dehennin
Les "étiquettes":http://git-scm.com/book/fr/Les-bases-de-Git-Étiquetage de la forme *@debian/*@* ne pointe sur aucune branche, ils ne sont utilisés que par l’infrastructure de compilation de paquet et ne sont donc que sur les dépôts *@dev-eole.ac-dijon.fr@*.
113 1 Daniel Dehennin
114 1 Daniel Dehennin
Pour récupérer la dernière "étiquette":http://git-scm.com/book/fr/Les-bases-de-Git-Étiquetage de paquet :
115 1 Daniel Dehennin
116 1 Daniel Dehennin
<pre>
117 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ git fetch $(git config branch.master.remote) refs/tags/${EOLE_DEB_TAG}:refs/tags/${EOLE_DEB_TAG}
118 1 Daniel Dehennin
</pre>
119 1 Daniel Dehennin
120 1 Daniel Dehennin
121 2 Daniel Dehennin
h3. Vérifier le message de l’étiquette
122 1 Daniel Dehennin
123 1 Daniel Dehennin
<pre>
124 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ git show -s --format="format:" ${EOLE_DEB_TAG} | perl -lane 'print if (/Debian release/ .. /^-+BEGIN/) =~ /^\d+$/'
125 1 Daniel Dehennin
eole-wordpress Debian release 3.6.1-eole3-1
126 1 Daniel Dehennin
127 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ DEB_MESSAGE=$(git show -s --format="format:" ${EOLE_DEB_TAG} | perl -lane 'print if (/Debian release/ .. /^-+BEGIN/) =~ /^\d+$/')
128 1 Daniel Dehennin
</pre>
129 1 Daniel Dehennin
130 2 Daniel Dehennin
h3. Dupliquer l’étiquette du dernier paquet EOLE 2.4 en première étiquette de paquet Envole
131 1 Daniel Dehennin
132 1 Daniel Dehennin
<pre>
133 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ git tag -m "${DEB_MESSAGE}" debian/envole/4/${VERSION} ${EOLE_DEB_TAG}^{}
134 1 Daniel Dehennin
</pre>
135 1 Daniel Dehennin
136 1 Daniel Dehennin
On vérifie le message
137 1 Daniel Dehennin
138 1 Daniel Dehennin
<pre>
139 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master)$ git show debian/envole/4/${VERSION}
140 1 Daniel Dehennin
</pre>
141 1 Daniel Dehennin
142 2 Daniel Dehennin
h3. Pousser la nouvelle étiquette
143 1 Daniel Dehennin
144 1 Daniel Dehennin
<pre>
145 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ git push $(git config branch.master.remote) debian/envole/4/${VERSION}
146 1 Daniel Dehennin
</pre>
147 1 Daniel Dehennin
148 1 Daniel Dehennin
149 1 Daniel Dehennin
150 2 Daniel Dehennin
h2. Passer le projet en paquet natif
151 1 Daniel Dehennin
152 1 Daniel Dehennin
Pour la gestion des [[eole:EoleDebianPackaging24#debiansourceformat|numéros de version]] de paquet:
153 1 Daniel Dehennin
154 1 Daniel Dehennin
<pre>
155 1 Daniel Dehennin
user@work:~src/wordpress (dist/envole/4/master=)$ mkdir -p debian/source
156 1 Daniel Dehennin
user@work:~src/wordpress (dist/envole/4/master=)$ cat >| debian/source/format <<EOF
157 1 Daniel Dehennin
3.0 (native)
158 1 Daniel Dehennin
EOF
159 1 Daniel Dehennin
160 1 Daniel Dehennin
user@work:~src/etherpad (dist/envole/4/master*=)$ git add debian/source/format
161 1 Daniel Dehennin
user@work:~src/etherpad (dist/envole/4/master+=)$ 
162 1 Daniel Dehennin
</pre>
163 1 Daniel Dehennin
164 1 Daniel Dehennin
165 1 Daniel Dehennin
166 2 Daniel Dehennin
h2. Modifier la configuration git-buildpackage
167 1 Daniel Dehennin
168 1 Daniel Dehennin
Il faut modifier modifier le fichier de configuration *@debian/gbp.conf@* afin de modifier le format des "étiquettes":http://git-scm.com/book/fr/Les-bases-de-Git-Étiquetage de suivi des compilations:
169 1 Daniel Dehennin
170 1 Daniel Dehennin
<pre>
171 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master+=)$ sed -i -e 's,^debian-tag.*,debian-tag = debian/envole/4/%(version)s,' debian/gbp.conf
172 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master*+=)$ git add debian/gbp.conf
173 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master+=)$ git commit -m "Configuration pour l’infrastructure de compilation EOLE
174 1 Daniel Dehennin
175 1 Daniel Dehennin
* debian/gbp.conf: Définition du format des étiquettes de compilation
176 1 Daniel Dehennin
  pour Envole."
177 1 Daniel Dehennin
178 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master>)$ 
179 1 Daniel Dehennin
</pre>
180 1 Daniel Dehennin
181 1 Daniel Dehennin
{{include(envole:End-PreparationEnvole4)}}