Skip to content
Snippets Groups Projects
Commit a26b8f88 authored by Claire Hernandez's avatar Claire Hernandez
Browse files

Adds a note about upgrading bokeh

parent a5b17400
Branches
Tags
6 merge requests!529Hotline 6.56,!512Master,!500Hotline 6.55,!484Master,!468Hotline #16972 upgrade doc,!455Hotline #16972 upgrade doc
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
}
function executeCommand() {
cmd=$1
echo "$cmd"
eval $cmd || die $2 > /dev/null 2>&1
echo "done"
echo ""
}
function printError() {
errors=$errors$'\n'$1
}
function forceExecuteCommand() {
cmd=$1
echo "$cmd"
eval $cmd || printError $2 > /dev/null 2>&1
echo "done"
echo ""
}
function printErrors() {
echo $errors
}
function switchSymLinks() {
local client_dir=$1
local absolute_current_dir=$2
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"
}
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
}
```
exemple du fichier stable
```
6.54.2
```
## Mise à jour de la base de données
La base de données peut être mise à jour en ligne de commande ou via l'interface.
```
$ php cosmogramme/php/upgrade_db.php
```
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment