Projet

Général

Profil

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

Daniel Dehennin, 20/02/2015 11:15

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 1 Daniel Dehennin
[[MigrationAppliEnvole4#État-des-lieux-application-par-application|La plupart des préparatifs ont déjà été fait]].
12 1 Daniel Dehennin
13 1 Daniel Dehennin
Il faut migrer certains éléments pour l’utilisation des "dépôts Envole":http://eole.ac-dijon.fr/envole.
14 1 Daniel Dehennin
15 1 Daniel Dehennin
*@ATTENTION@* : Assurez-vous que les branches soient bien à jour par rapport aux dépôts sur *@dev-eole.ac-dijon.fr@*.
16 1 Daniel Dehennin
17 1 Daniel Dehennin
18 1 Daniel Dehennin
19 2 Daniel Dehennin
h2. Dupliquer la branche de compilation EOLE 2.3 en branche de compilation Envole 4
20 1 Daniel Dehennin
21 1 Daniel Dehennin
<pre>
22 1 Daniel Dehennin
user@work:~/src/wordpress (master)$ git checkout -b dist/envole/4/master dist/ubuntu/precise/master
23 1 Daniel Dehennin
24 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master)$ git push -u $(git config branch.master.remote) dist/envole/4/master
25 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ 
26 1 Daniel Dehennin
</pre>
27 1 Daniel Dehennin
28 1 Daniel Dehennin
29 1 Daniel Dehennin
30 2 Daniel Dehennin
h2. Renommer l’étiquette de la dernière compilation EOLE 2.4
31 1 Daniel Dehennin
32 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.
33 1 Daniel Dehennin
34 1 Daniel Dehennin
35 2 Daniel Dehennin
h3. Déterminer l’étiquette de la dernière compilation EOLE 2.4
36 1 Daniel Dehennin
37 1 Daniel Dehennin
<pre>
38 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ git describe --abbrev=0 dist/ubuntu/precise/master
39 1 Daniel Dehennin
pkg/eole/eole-2.4/3.6.1-eole3-1
40 1 Daniel Dehennin
41 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ EOLE_TAG=$(git describe --abbrev=0 dist/ubuntu/precise/master)
42 1 Daniel Dehennin
</pre>
43 1 Daniel Dehennin
44 2 Daniel Dehennin
h3. Extraire la version
45 1 Daniel Dehennin
46 1 Daniel Dehennin
<pre>
47 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ echo ${EOLE_TAG##*/}
48 1 Daniel Dehennin
3.6.1-eole3-1
49 1 Daniel Dehennin
50 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ VERSION=${EOLE_TAG##*/}
51 1 Daniel Dehennin
</pre>
52 1 Daniel Dehennin
53 2 Daniel Dehennin
h3. Vérifier le message de l’étiquette
54 1 Daniel Dehennin
55 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@* :
56 1 Daniel Dehennin
57 1 Daniel Dehennin
<pre>
58 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+$/'
59 1 Daniel Dehennin
Lionel MORIN: New package version 3.6.1-eole3-1 for eole-2.4-unstable.
60 1 Daniel Dehennin
[...]
61 1 Daniel Dehennin
62 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+$/')
63 1 Daniel Dehennin
</pre>
64 1 Daniel Dehennin
65 2 Daniel Dehennin
h3. Dupliquer l’étiquette de la dernière compilation EOLE 2.4 en première étiquette de compilation Envole
66 1 Daniel Dehennin
67 1 Daniel Dehennin
* Créer l’"étiquette":http://git-scm.com/book/fr/Les-bases-de-Git-Étiquetage
68 1 Daniel Dehennin
<pre>
69 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ git tag -m "${EOLE_MESSAGE}" pkg/envole/envole-4/${VERSION} ${EOLE_TAG}^{}
70 1 Daniel Dehennin
</pre>
71 1 Daniel Dehennin
* Vérifier le message de l’"étiquette":http://git-scm.com/book/fr/Les-bases-de-Git-Étiquetage
72 1 Daniel Dehennin
<pre>
73 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ git show pkg/envole/envole-4/${VERSION}
74 1 Daniel Dehennin
</pre>
75 1 Daniel Dehennin
76 2 Daniel Dehennin
h3. Pousser la nouvelle étiquette 
77 1 Daniel Dehennin
78 1 Daniel Dehennin
<pre>
79 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ git push --tags
80 1 Daniel Dehennin
</pre>
81 1 Daniel Dehennin
82 2 Daniel Dehennin
h2. Renommé l’étiquette du dernier paquet EOLE 2.4
83 1 Daniel Dehennin
84 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@*.
85 1 Daniel Dehennin
86 1 Daniel Dehennin
87 2 Daniel Dehennin
h3. Déterminer l’étiquette du dernier paquet EOLE 2.4
88 1 Daniel Dehennin
89 1 Daniel Dehennin
<pre>
90 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},"
91 1 Daniel Dehennin
 debian/eole/2.4/3.6.1-eole3-1
92 1 Daniel Dehennin
93 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},"))
94 1 Daniel Dehennin
</pre>
95 1 Daniel Dehennin
96 1 Daniel Dehennin
97 2 Daniel Dehennin
h3. Récupérer l’étiquette du dernier paquet EOLE 2.4
98 1 Daniel Dehennin
99 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@*.
100 1 Daniel Dehennin
101 1 Daniel Dehennin
Pour récupérer la dernière "étiquette":http://git-scm.com/book/fr/Les-bases-de-Git-Étiquetage de paquet :
102 1 Daniel Dehennin
103 1 Daniel Dehennin
<pre>
104 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}
105 1 Daniel Dehennin
</pre>
106 1 Daniel Dehennin
107 1 Daniel Dehennin
108 2 Daniel Dehennin
h3. Vérifier le message de l’étiquette
109 1 Daniel Dehennin
110 1 Daniel Dehennin
<pre>
111 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+$/'
112 1 Daniel Dehennin
eole-wordpress Debian release 3.6.1-eole3-1
113 1 Daniel Dehennin
114 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+$/')
115 1 Daniel Dehennin
</pre>
116 1 Daniel Dehennin
117 2 Daniel Dehennin
h3. Dupliquer l’étiquette du dernier paquet EOLE 2.4 en première étiquette de paquet Envole
118 1 Daniel Dehennin
119 1 Daniel Dehennin
<pre>
120 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ git tag -m "${DEB_MESSAGE}" debian/envole/4/${VERSION} ${EOLE_DEB_TAG}^{}
121 1 Daniel Dehennin
</pre>
122 1 Daniel Dehennin
123 1 Daniel Dehennin
On vérifie le message
124 1 Daniel Dehennin
125 1 Daniel Dehennin
<pre>
126 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master)$ git show debian/envole/4/${VERSION}
127 1 Daniel Dehennin
</pre>
128 1 Daniel Dehennin
129 2 Daniel Dehennin
h3. Pousser la nouvelle étiquette
130 1 Daniel Dehennin
131 1 Daniel Dehennin
<pre>
132 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master=)$ git push $(git config branch.master.remote) debian/envole/4/${VERSION}
133 1 Daniel Dehennin
</pre>
134 1 Daniel Dehennin
135 1 Daniel Dehennin
136 1 Daniel Dehennin
137 2 Daniel Dehennin
h2. Passer le projet en paquet natif
138 1 Daniel Dehennin
139 1 Daniel Dehennin
Pour la gestion des [[eole:EoleDebianPackaging24#debiansourceformat|numéros de version]] de paquet:
140 1 Daniel Dehennin
141 1 Daniel Dehennin
<pre>
142 1 Daniel Dehennin
user@work:~src/wordpress (dist/envole/4/master=)$ mkdir -p debian/source
143 1 Daniel Dehennin
user@work:~src/wordpress (dist/envole/4/master=)$ cat >| debian/source/format <<EOF
144 1 Daniel Dehennin
3.0 (native)
145 1 Daniel Dehennin
EOF
146 1 Daniel Dehennin
147 1 Daniel Dehennin
user@work:~src/etherpad (dist/envole/4/master*=)$ git add debian/source/format
148 1 Daniel Dehennin
user@work:~src/etherpad (dist/envole/4/master+=)$ 
149 1 Daniel Dehennin
</pre>
150 1 Daniel Dehennin
151 1 Daniel Dehennin
152 1 Daniel Dehennin
153 2 Daniel Dehennin
h2. Modifier la configuration git-buildpackage
154 1 Daniel Dehennin
155 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:
156 1 Daniel Dehennin
157 1 Daniel Dehennin
<pre>
158 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
159 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master*+=)$ git add debian/gbp.conf
160 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master+=)$ git commit -m "Configuration pour l’infrastructure de compilation EOLE
161 1 Daniel Dehennin
162 1 Daniel Dehennin
* debian/gbp.conf: Définition du format des étiquettes de compilation
163 1 Daniel Dehennin
  pour Envole."
164 1 Daniel Dehennin
165 1 Daniel Dehennin
user@work:~/src/wordpress (dist/envole/4/master>)$ 
166 1 Daniel Dehennin
</pre>
167 1 Daniel Dehennin
168 1 Daniel Dehennin
{{include(envole:End-PreparationEnvole4)}}