From c7bcf61654997fb183d6fe33afe3bc4043239b8b Mon Sep 17 00:00:00 2001
From: Claire Hernandez <claire.hernandez@biblibre.com>
Date: Mon, 20 Oct 2014 14:04:16 +0200
Subject: [PATCH] page refacor with merge request feedbacks

---
 UPGRADE.fr.md | 166 ++++----------------------------------------------
 1 file changed, 12 insertions(+), 154 deletions(-)

diff --git a/UPGRADE.fr.md b/UPGRADE.fr.md
index 0eb647061a6..58f0067d0b3 100644
--- a/UPGRADE.fr.md
+++ b/UPGRADE.fr.md
@@ -1,169 +1,27 @@
 Sauf indiqué, cette procédure prends en compte par défaut les distributions GNU/Linux Ubuntu et Debian
 
-# Mise à jour de Bokeh
-
-La mise à jour d'un portail se fait en plusieurs phase: mise à jour des sources puis mise à jour de la base de données.
-
-## Mise à jour des sources
-
-Les sources peuvent être mises à jour avec le script qui suit à adapter en fonction de vos besoins
-
-script install.sh
-```
-#!/bin/bash
-exec_path="$( cd "$( dirname "$0" )" && pwd )"
-source $exec_path"/install-util.sh"
-
-
-STABLE_VERSION=$(cat $exec_path/stable)
-
-if [ -d opacce ]; then
-  nextStep "Update opacce"
-  executeCommand "cd opacce; git reset --hard HEAD; " "error on reset"
-else
-  nextStep "Clone opacce"
-  executeCommand "git clone git@git.afi-sa.fr:afi/opacce opacce; cd opacce" "Unable to clone"
-fi
-
-nextStep "Switch to stable version $STABLE_VERSION"
-executeCommand 'git fetch -t --all' '[ERROR] Unable to fetch'
-git branch -f "stable-$STABLE_VERSION" $STABLE_VERSION
-git checkout "stable-$STABLE_VERSION" || die '[ERROR] Unable to checkout to stable version'
-
-updateSubmodules
-
-version=`git branch |grep "^*"|cut -c3-`
-version_stable=`cat ../stable`
-if [ "$version" == "stable-"$STABLE_VERSION ]; then
-  successMessage
-else
-  errorMessage
-fi
-```
-
-script install-util.sh
-```
-#!/bin/bash
-
-function nextStep() {
-    echo ""
-    echo "==== $1 ===="
-    echo ""
-}
-
-
-function die() {
-    echo $1
-    exit 1
-}
-
+# Pré-requis
 
-function executeCommand() {
-    cmd=$1
-    echo "$cmd"
-    eval  $cmd || die $2 > /dev/null 2>&1
-    echo "done"
-    echo ""
-}
+## Mettre votre site en maintenance
 
-function printError() {
-    errors=$errors$'\n'$1
-}
+Vous pouvez mettre votre site en maintenance avant de commencer toute opération: dans l'interface d'administration sur la page d'accueil il y a un lien "rendre le site indisponible". À la fin de l'opération, pensez à cliquer sur "remettre le site en ligne".
 
-function forceExecuteCommand() {
-    cmd=$1
-    echo "$cmd"
-    eval  $cmd  || printError $2 > /dev/null 2>&1
-    echo "done"
-    echo ""
-}
+## Sauvegarder votre site
 
-function printErrors() {
-    echo $errors
-}
+Pensez à faire une sauvegarde de votre base de données ainsi que de votre dossier de sources. En effet, si la base de données est impactée dans la mise à jour il est fortement déconseillé d'essayer de "downgrader" après application des patchs. Si vous constatez un problème suite à la mise à jour, nous vous conseillons de réinjecter votre dump de base de données et de faire un retour arrière sur les sources.
 
-function switchSymLinks() {
-    local client_dir=$1
-    local absolute_current_dir=$2
+## Identifier la version
 
-    forceExecuteCommand "ln -fs $absolute_current_dir/index.php $client_dir/index.php && 
-ln -fs $absolute_current_dir/public $client_dir/ && ln -fs $absolute_current_dir/cosmogramme/index.php $client_dir/cosmogramme/index.php && ln -fs $absolute_current_dir/cosmogramme/cosmozend $client_dir/cosmogramme/ && ln -fs $absolute_current_dir/cosmogramme/css $client_dir/cosmogramme/ && ln -fs $absolute_current_dir/cosmogramme/images $client_dir/cosmogramme/ && ln -fs $absolute_current_dir/cosmogramme/java_script $client_dir/cosmogramme/ && ln -fs $absolute_current_dir/cosmogramme/php $client_dir/cosmogramme/ && ln -fs $absolute_current_dir/cosmogramme/sql $client_dir/cosmogramme/" "can't link to $absolute_current_dir" "Unable_to_link_file_in_$client_dir"
-}
-
-
-function cloneBranch() {
-    local BRANCH=$1
-    if [ -d $BRANCH ]; then
-	nextStep "Update $BRANCH"
-	executeCommand "cd $BRANCH; git reset --hard HEAD; " "error on reset"
-    else
-	nextStep "Clone $BRANCH"
-	executeCommand "git clone -b $BRANCH git@git.afi-sa.fr:afi/opacce $BRANCH; cd $BRANCH"  "Unable to clone"
-    fi
-    nextStep "Switch to  version $BRANCH"
-    executeCommand 'git fetch -t --all' '[ERROR] Unable to fetch'
-
-    updateSubmodules
-}
-
-
-function updateSubmodules() {
-    if [ -d afi ]; then
-	nextStep "Update proprietary addons"
-	executeCommand "cd afi; git reset --hard HEAD;git pull; cd .." "Unable to pull "
-    else
-	nextStep "Clone proprietary addons"
-	executeCommand "git clone git@git.afi-sa.fr:afi/opacpriv afi" "Unable to clone"
-    fi
-
-    pwd
-
-    nextStep "Install flash components"
-    executeCommand "cp -rf afi/public/opacpriv/flash public/opac/flash" "Cant copy in public/opac/flash"
-
-    nextStep "Update submodules"
-    executeCommand "git submodule init && sh update.sh" "Can't update submodules"
-
-    nextStep "Set permissions on temp folder"
-    forceExecuteCommand "chmod -R 777 temp" 
-
-    nextStep "Check install"
-}
-
-
-function successMessage() {
-    echo "[DONE]"
-    echo "[IF NEEDED] copy and configure index.php,config.ini,cosmogramme/config.php"
-    echo "Enjoy :)"
-}
-
-
-function errorMessage() {
-    local version=$1
-    echo "[ERROR] wrong version : $version"
-}
+Lorsqu'une version est publiée par l'équipe Bokeh, elle est identifiable par un tag: http://git.afi-sa.fr/afi/opacce/tags
+Les apports des versions sont consignés dans le fichier VERSIONS de la racine du projet: http://git.afi-sa.fr/afi/opacce/blob/master/VERSIONS Les dernières versions sont complétées par une page dans le wiki qui apporte un éclairage plus fonctionnel aux ajouts des développements: wiki.bokeh-library-portal.org/index.php/Category:Notes_de_version.
 
+# Mise à jour de Bokeh
 
-function updateSymlinksAndTest() {
-    local BRANCH=$1
-    local CLIENT_DIR=$2
-    local branch_dir=$3
-    local version=`git branch |grep "^*"|cut -c3-`
-    if [ "$version" == "$BRANCH" ]; then
-	switchSymLinks "$CLIENT_DIR" $branch_dir
-	echo '{ "branch" : "'$version'"}' >  "$branch_dir/public/opac/branch.txt"
-	successMessage
-    else
-	errorMessage
-    fi
-}
+La mise à jour d'un portail se fait en plusieurs phase: mise à jour des sources puis mise à jour de la base de données.
 
-```
+## Mise à jour des sources
 
-exemple du fichier stable
-```
-6.54.2
-```
+Vous devez positionner vos sources sur le tag choisi (vous référer notamment aux commandes git checkout et git rebase).
 
 ## Mise à jour de la base de données
 
-- 
GitLab