Projet

Général

Profil

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

Daniel Dehennin, 20/02/2015 11:11

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