MigrationAppliEnvole4 » Historique » Version 19
Lionel Morin, 08/07/2013 14:14
1 | 1 | Lionel Morin | h1. Migration d'une application Envole vers la version EOLE 2.4 (ébauche) |
---|---|---|---|
2 | 1 | Lionel Morin | |
3 | 3 | Lionel Morin | Pour faciliter le travail de packaging, il est nécessaire de [[eole-skeletor:Doc-geting-started| "skeletoriser"]] le dépot 2.3 pour le [[eole:EoleDebianPackaging24| transformer en dépot 2.4]]. |
4 | 5 | Lionel Morin | |
5 | 13 | Lionel Morin | h2. Nouvelle organisation du dépot git |
6 | 1 | Lionel Morin | |
7 | 13 | Lionel Morin | Une nouvelle organisation globale des dépots git pour Envole est mise en place et sera commune pour 2.3 et 2.4. |
8 | 13 | Lionel Morin | |
9 | 13 | Lionel Morin | h3. Description des branches |
10 | 13 | Lionel Morin | |
11 | 8 | Lionel Morin | |_.Sources originales |_.Sources modifiées pour Envole |_.Ajouts EOLE |_.Packaging | |
12 | 13 | Lionel Morin | |/2=.upstream |/2=.=> patch |/2=.=> master |=> packaging 2.3| |
13 | 1 | Lionel Morin | | => packaging 2.4| |
14 | 4 | Lionel Morin | |
15 | 15 | Lionel Morin | * la branche _*upstream*_ ne contient que les sources originales de l'application et sert de référence pour la branche patch |
16 | 13 | Lionel Morin | * la branche _*patch*_ contient les sources patchées pour envole (il y a ici possibilité de générer un paquet envole-<nom_appli>) |
17 | 1 | Lionel Morin | * la branche _*master*_ est commune en 2.3 et 2.4 (sous réserve de rester compatible) et comporte, en plus des sources, tous les ajouts EOLE (templates, dicos, scripts, sql, password...) |
18 | 14 | Lionel Morin | * les branches de *_packaging_*, une par version |
19 | 13 | Lionel Morin | |
20 | 13 | Lionel Morin | h3. Étapes de migration d'un dépot |
21 | 13 | Lionel Morin | |
22 | 14 | Lionel Morin | # Créer la branche "patch" à partir de "master" : |
23 | 13 | Lionel Morin | <pre> |
24 | 14 | Lionel Morin | user:~/depot/monappli (master)$ git checkout -b patch |
25 | 1 | Lionel Morin | </pre> |
26 | 1 | Lionel Morin | # Supprimer tout le contenu autre que le dossier src : |
27 | 14 | Lionel Morin | <pre> |
28 | 16 | Lionel Morin | user:~/depot/monappli (patch)$ git rm -r dicos/* sso/* tmpl/* sql/* Makefile eole.mk apps.mk # etc... |
29 | 14 | Lionel Morin | </pre> |
30 | 14 | Lionel Morin | # Commiter |
31 | 14 | Lionel Morin | <pre> |
32 | 14 | Lionel Morin | user:~/depot/monappli (patch)$ git commit -m "Suppression de la partie EOLE" |
33 | 14 | Lionel Morin | </pre> |
34 | 17 | Lionel Morin | # Créer la branche "upstream" à partir de "patch" : |
35 | 17 | Lionel Morin | <pre> |
36 | 17 | Lionel Morin | user:~/depot/monappli (patch)$ git checkout -b upstream |
37 | 17 | Lionel Morin | </pre> |
38 | 17 | Lionel Morin | # Supprimer toutes les sources du dossier src : |
39 | 17 | Lionel Morin | <pre> |
40 | 17 | Lionel Morin | user:~/depot/monappli (upstream)$ git rm -r src/monappli-1.0.0/* src/plugins-1.0.0/* # etc... |
41 | 17 | Lionel Morin | </pre> |
42 | 17 | Lionel Morin | # Télécharger les sources de l'application depuis le site d'origine (fichier tar.gz) |
43 | 17 | Lionel Morin | # Décompresser les sources dans le dossier src et renommer le dossier selon la nomenclature skeletor : |
44 | 17 | Lionel Morin | <pre> |
45 | 18 | Lionel Morin | user:~/depot/monappli (upstream)/src$ tar -xvzf ~/monappli-1.0.0.tar.gz |
46 | 18 | Lionel Morin | user:~/depot/monappli (upstream)$ mv monappli monappli-1.0.0 |
47 | 17 | Lionel Morin | </pre> |
48 | 19 | Lionel Morin | # Commiter |
49 | 19 | Lionel Morin | <pre> |
50 | 19 | Lionel Morin | user:~/depot/monappli (upstream)$ git commit -m "Mise en place des sources 1.0.0" |
51 | 19 | Lionel Morin | </pre> |
52 | 19 | Lionel Morin | # Merge de la branche "upstream" dans "patch" (avec une option pour conserver les fichiers de "patch") : |
53 | 19 | Lionel Morin | <pre> |
54 | 19 | Lionel Morin | user:~/depot/monappli (upstream)$ git checkout patch |
55 | 19 | Lionel Morin | user:~/depot/monappli (patch)$ git merge -s ours upstream |
56 | 19 | Lionel Morin | </pre> |
57 | 19 | Lionel Morin | # Merge de la branche "patch" dans "master" (avec une option pour conserver les fichiers de "master") : |
58 | 19 | Lionel Morin | <pre> |
59 | 19 | Lionel Morin | user:~/depot/monappli (patch)$ git checkout master |
60 | 19 | Lionel Morin | user:~/depot/monappli (master)$ git merge -s ours patch |
61 | 19 | Lionel Morin | </pre> |
62 | 1 | Lionel Morin | |
63 | 1 | Lionel Morin | h2. Modification des dicos |
64 | 1 | Lionel Morin | |
65 | 1 | Lionel Morin | Normalement il n'y a rien à changer. |
66 | 1 | Lionel Morin | |
67 | 1 | Lionel Morin | h2. Modification des templates |
68 | 1 | Lionel Morin | |
69 | 1 | Lionel Morin | Certaines variables souvent utilisées dans Envole ont changé de nom. |
70 | 1 | Lionel Morin | |
71 | 1 | Lionel Morin | |_.Nom en 2.3 |_.Nouveau nom en 2.4 | |
72 | 1 | Lionel Morin | |adresse_ip_annuaire |container_ip_annuaire | |
73 | 1 | Lionel Morin | |adresse_ip_fichier |container_ip_fichier | |
74 | 1 | Lionel Morin | |adresse_ip_mail |container_ip_mail | |
75 | 1 | Lionel Morin | |adresse_ip_mysql |container_ip_mysql | |
76 | 1 | Lionel Morin | |adresse_ip_web |container_ip_web | |
77 | 1 | Lionel Morin | |
78 | 3 | Lionel Morin | *=> Ces variables peuvent être rajoutées en 2.4 pour une rétro-compatibilité* |
79 | 1 | Lionel Morin | |
80 | 1 | Lionel Morin | h2. Modification des scripts shell |
81 | 2 | Lionel Morin | |
82 | 2 | Lionel Morin | h3. CreoleGet |
83 | 2 | Lionel Morin | |
84 | 2 | Lionel Morin | <pre> |
85 | 2 | Lionel Morin | .ParseDico |
86 | 2 | Lionel Morin | echo $mavariable |
87 | 2 | Lionel Morin | </pre> |
88 | 2 | Lionel Morin | est remplacé par : |
89 | 2 | Lionel Morin | <pre> |
90 | 2 | Lionel Morin | echo $(CreoleGet mavariable) |
91 | 2 | Lionel Morin | </pre> |
92 | 2 | Lionel Morin | |
93 | 2 | Lionel Morin | ATTENTION : à ce jour, pour accéder à une variable esclave, il faut connaître la variable maître : |
94 | 2 | Lionel Morin | <pre> |
95 | 1 | Lionel Morin | echo $(CreoleGet lamaster.lesclave) |
96 | 1 | Lionel Morin | </pre> |
97 | 2 | Lionel Morin | |
98 | 12 | Lionel Morin | *=> Il est possible de tester la présence de ParseDico avant de le lancer et ainsi faire en sorte d'avoir des scripts communs en 2.3 et en 2.4* |
99 | 3 | Lionel Morin | |
100 | 10 | Lionel Morin | Code à confirmer : |
101 | 7 | Lionel Morin | <pre> |
102 | 10 | Lionel Morin | if type -p ParseDico &> /dev/null; then |
103 | 11 | Lionel Morin | .ParseDico |
104 | 11 | Lionel Morin | else |
105 | 11 | Lionel Morin | # initialisation des variables utilisées |
106 | 11 | Lionel Morin | adresse_ip_br0=$(CreoleGet adresse_ip_br0) |
107 | 1 | Lionel Morin | fi |
108 | 11 | Lionel Morin | |
109 | 11 | Lionel Morin | echo $adresse_ip_br0 |
110 | 7 | Lionel Morin | </pre> |
111 | 7 | Lionel Morin | |
112 | 2 | Lionel Morin | h3. CreoleRun |
113 | 2 | Lionel Morin | |
114 | 2 | Lionel Morin | <pre> |
115 | 2 | Lionel Morin | ./usr/share/eole/FonctionsEoleNg |
116 | 2 | Lionel Morin | RunCmd "ma -commande" conteneur |
117 | 2 | Lionel Morin | </pre> |
118 | 2 | Lionel Morin | est remplacé par : |
119 | 1 | Lionel Morin | <pre> |
120 | 1 | Lionel Morin | CreoleRun "ma -commande" conteneur |
121 | 2 | Lionel Morin | </pre> |
122 | 3 | Lionel Morin | |
123 | 3 | Lionel Morin | *=> Il est possible d'émuler la commande RunCmd en 2.4* |
124 | 2 | Lionel Morin | |
125 | 2 | Lionel Morin | h2. Problèmes spécifiques |
126 | 2 | Lionel Morin | |
127 | 2 | Lionel Morin | h3. Problème de connexion aux bases MySQL #5633 |
128 | 2 | Lionel Morin | |
129 | 2 | Lionel Morin | Pour y remédier temporairement, on peut mettre "localhost" à la place de "127.0.0.1" (penser à la fois aux fichiers sql et aux fichiers de config php). |