MigrationAppliEnvole4 » Historique » Version 18
Lionel Morin, 04/07/2013 16:41
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 | 1 | Lionel Morin | |
49 | 1 | Lionel Morin | h2. Modification des dicos |
50 | 1 | Lionel Morin | |
51 | 1 | Lionel Morin | Normalement il n'y a rien à changer. |
52 | 1 | Lionel Morin | |
53 | 1 | Lionel Morin | h2. Modification des templates |
54 | 1 | Lionel Morin | |
55 | 1 | Lionel Morin | Certaines variables souvent utilisées dans Envole ont changé de nom. |
56 | 1 | Lionel Morin | |
57 | 1 | Lionel Morin | |_.Nom en 2.3 |_.Nouveau nom en 2.4 | |
58 | 1 | Lionel Morin | |adresse_ip_annuaire |container_ip_annuaire | |
59 | 1 | Lionel Morin | |adresse_ip_fichier |container_ip_fichier | |
60 | 1 | Lionel Morin | |adresse_ip_mail |container_ip_mail | |
61 | 1 | Lionel Morin | |adresse_ip_mysql |container_ip_mysql | |
62 | 1 | Lionel Morin | |adresse_ip_web |container_ip_web | |
63 | 1 | Lionel Morin | |
64 | 3 | Lionel Morin | *=> Ces variables peuvent être rajoutées en 2.4 pour une rétro-compatibilité* |
65 | 1 | Lionel Morin | |
66 | 1 | Lionel Morin | h2. Modification des scripts shell |
67 | 2 | Lionel Morin | |
68 | 2 | Lionel Morin | h3. CreoleGet |
69 | 2 | Lionel Morin | |
70 | 2 | Lionel Morin | <pre> |
71 | 2 | Lionel Morin | .ParseDico |
72 | 2 | Lionel Morin | echo $mavariable |
73 | 2 | Lionel Morin | </pre> |
74 | 2 | Lionel Morin | est remplacé par : |
75 | 2 | Lionel Morin | <pre> |
76 | 2 | Lionel Morin | echo $(CreoleGet mavariable) |
77 | 2 | Lionel Morin | </pre> |
78 | 2 | Lionel Morin | |
79 | 2 | Lionel Morin | ATTENTION : à ce jour, pour accéder à une variable esclave, il faut connaître la variable maître : |
80 | 2 | Lionel Morin | <pre> |
81 | 1 | Lionel Morin | echo $(CreoleGet lamaster.lesclave) |
82 | 1 | Lionel Morin | </pre> |
83 | 2 | Lionel Morin | |
84 | 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* |
85 | 3 | Lionel Morin | |
86 | 10 | Lionel Morin | Code à confirmer : |
87 | 7 | Lionel Morin | <pre> |
88 | 10 | Lionel Morin | if type -p ParseDico &> /dev/null; then |
89 | 11 | Lionel Morin | .ParseDico |
90 | 11 | Lionel Morin | else |
91 | 11 | Lionel Morin | # initialisation des variables utilisées |
92 | 11 | Lionel Morin | adresse_ip_br0=$(CreoleGet adresse_ip_br0) |
93 | 1 | Lionel Morin | fi |
94 | 11 | Lionel Morin | |
95 | 11 | Lionel Morin | echo $adresse_ip_br0 |
96 | 7 | Lionel Morin | </pre> |
97 | 7 | Lionel Morin | |
98 | 2 | Lionel Morin | h3. CreoleRun |
99 | 2 | Lionel Morin | |
100 | 2 | Lionel Morin | <pre> |
101 | 2 | Lionel Morin | ./usr/share/eole/FonctionsEoleNg |
102 | 2 | Lionel Morin | RunCmd "ma -commande" conteneur |
103 | 2 | Lionel Morin | </pre> |
104 | 2 | Lionel Morin | est remplacé par : |
105 | 1 | Lionel Morin | <pre> |
106 | 1 | Lionel Morin | CreoleRun "ma -commande" conteneur |
107 | 2 | Lionel Morin | </pre> |
108 | 3 | Lionel Morin | |
109 | 3 | Lionel Morin | *=> Il est possible d'émuler la commande RunCmd en 2.4* |
110 | 2 | Lionel Morin | |
111 | 2 | Lionel Morin | h2. Problèmes spécifiques |
112 | 2 | Lionel Morin | |
113 | 2 | Lionel Morin | h3. Problème de connexion aux bases MySQL #5633 |
114 | 2 | Lionel Morin | |
115 | 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). |