Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Mise à jour (CentOS 7)

DrClockwork edited this page May 23, 2017 · 2 revisions

Informations : Cette documentation est tirée de la documentation technique de Pod sur CentOS 7 de l'Université de Montpellier. La version PDF de cette documentation, pour ceux le désirant, sera bientôt disponible. Sur ce wiki il s'agit d'une reprise du chapitre "Mise à jour".

Mise à jour

Voici des exemples de commandes exécutées pour la mise à jour d'une version 1.5 vers 1.5.2 Pour l'environnement de tests, avant toute chose, il faut arrêter le serveur Pod :

service pod stop

Pour connaitre la version installée :

[pod@tspod ~]$ cd /opt/django_projects/pod
[pod@tspod ~/opt/django_projects/pod]$ git remote update
[pod@tspod ~/opt/django_projects/pod]$ git describe --abbrev=0 --tags

Sauvegarde du répertoire de Pod :

[pod@tspod ~/opt/django_projects/pod]$ cd ..
[pod@tspod ~/opt/django_projects/]$ cp -r pod pod_1.5.2
[pod@tspod ~/opt/django_projects/]$ cd pod_1.5.2/

Mise à jour de la copie :

[pod@tspod ~/opt/django_projects/pod_1.5.2]$ git pull origin master

Remarque : Pour l'environnement de test, il peut s'avérer utile de tester la branche de développement de Pod. Pour ce faire il suffit de replacer master par dev dans la commande précédente :

[pod@tspod ~/opt/django_projects/pod_1.5.2]$ git pull origin dev

Remarque : Cette commande a déjà provoquée une erreur avec un fichier, du type error: Your local changes to the following files would be overwritten by merge: pod_project/django_cas_gateway/middleware.py.

la commande suivante a résolu le problème :

[pod@tspod ~/opt/django_projects/pod_1.5.2]$ git checkout HEAD^ pod_project/django_cas_gateway/middleware.py

Mise à jour des paquets :

[pod@tspod ~/opt/django_projects/pod_1.5.2]$ workon django_pod
[pod@tspod ~/opt/django_projects/pod_1.5.2]$ pip install -r
requirements.txt
[pod@tspod ~/opt/django_projects/pod_1.5.2]$ cd pod_project/pod_project

Sauvegarde des anciens fichiers de configuration et création puis édition des nouveaux :

[pod@tspod ~/opt/django_projects/pod_1.5.2/pod_project/pod_project]$ mv settings.py settings.py.bak
[pod@tspod ~/opt/django_projects/pod_1.5.2/pod_project/pod_project]$ mv settings_local.py settings_local.py.bak
[pod@tspod ~/opt/django_projects/pod_1.5.2/pod_project/pod_project]$ cp settings-sample.py settings.py
[pod@tspod ~/opt/django_projects/pod_1.5.2/pod_project/pod_project]$ cp settings_local-sample.py settings_local.py
[pod@tspod ~/opt/django_projects/pod_1.5.2/pod_project/pod_project]$ emacs setting.py
[pod@tspod ~/opt/django_projects/pod_1.5.2/pod_project/pod_project]$ emacs settings_local.py

Migration de la base de données :

[pod@tspod ~/opt/django_projects/pod_1.5.2/pod_project/pod_project]$ cd ..
[pod@tspod ~/opt/django_projects/pod_1.5.2/pod_project]$ python manage.py makemigrations
[pod@tspod ~/opt/django_projects/pod_1.5.2/pod_project]$ python manage.py migrate

Gestion du fichier de traduction :

[pod@tspod ~/opt/django_projects/pod_1.5.2/pod_project]$ cp ../traduction/django.po locale/fr/LC_MESSAGES/.
[pod@tspod ~/opt/django_projects/pod_1.5.2/pod_project]$ django-admin.py compilemessages

Mise à jour de pip si besoin :

[pod@tspod ~/opt/django_projects/pod_1.5.2/pod_project]$ pip install --upgrade pip

Création (si nécessaire) et réindexation des index Elasticsearch :

[pod@tspod ~/opt/django_projects/pod_1.5.2/pod_project]$ python manage.py create_pod_index
[pod@tspod ~/opt/django_projects/pod_1.5.2/pod_project]$ python manage.py index_videos __ALL__

Etant en test, vous pouvez seulement renommer les répertoires de l'ancienne et de la nouvelle version de Pod :

[pod@tspod ~/opt/django_projects/pod_1.5.2/pod_project]$ cd ../..
[pod@tspod ~/opt/django_projects]$ mv pod pod_1.5
[pod@tspod ~/opt/django_projects]$ mv pod_1.5.2 pod

Puis redémarrage du serveur Pod

Liste de diffusion du projet : [email protected]

Clone this wiki locally