#!/bin/bash ############################################################################### # # dc-svn-co : # Mise à jour d'une installation Dotclear 2.0 à partir des sources du SVN. # # Dépendances requises : # - subversion # - curl # # Attention : L'utilisation de ce script permet de mettre à jour votre instance # de Dotclear à partir d'une version dite instable ! # Utiliser à vos risques et périls ! # # Licence Dotclear : http://www.dotclear.net/license.html # # by Guillaume Kulakowski a.k.a LLaumgui # Version 2.0 # ############################################################################### # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, # - write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # - See http://www.gnu.org/licenses/gpl.html ############################################################################### ###################################### # Variables : # Chemin vers l'installation de Dotclear : DC_CORE_PATH="/home/www.xxx.com/www" # Chemin vers les plugins de Dotclear : DC_PLUGIN_PATH="$DC_CORE_PATH/plugins" # Chemin vers le cache : DC_CACHE_PATH="$DC_CORE_PATH/cache" # Liste des plugins à récupérer à partir du svn : DC_PLUGIN_LIST="antiflood commentsWikibar dayMode emailNotification gallery related sitemaps spamplemousse2" # Chemin vers votre administration (pour la requête de mise à jour) : DC_URL="http://www.xxx.com/admin/" SVN_DC_URL="https://svn.dotclear.net/2.0/trunk" SVN_DC_PLUGIN_URL="https://svn.dotclear.net/2.0/plugins" ###################################### # # #  # # #  # # # /!\ On touche plus /!\ # # # # # # # # # ###################################### ### # Mise à jour à partir du SVN : function svnCo() { cd "$1" svn co "$2" ./ } ### # Mise à jour de la liste des plugins à partir du svn : function svnPlugin () { for plugin in $DC_PLUGIN_LIST; do echo -e "\n\n############### $plugin ###############" # Création du répertoire pour les nouveaux plugins : if [ ! -d $DC_PLUGIN_PATH/$plugin ]; then echo "Le répertoire $plugin n'existe pas !" echo "Création du répertoire $plugin." mkdir "$DC_PLUGIN_PATH/$plugin" fi; svnCo "$DC_PLUGIN_PATH/$plugin" "$SVN_DC_PLUGIN_URL/$plugin" done; } ### # Mise à jour de la base par appel de l'url de l'admin : function updateDB() { curl $DC_URL } ### # On vide le cache function cleanCache() { rm -rf "$DC_CACHE_PATH/cbfeed" rm -rf "$DC_CACHE_PATH/cbtpl" } echo "################################################################################" echo "#   #" echo "# Mise à jour de Dotclear à partir des sources SVN #" echo "#  #" echo "################################################################################" svnCo "$DC_CORE_PATH" "$SVN_DC_URL" echo -e "\n\n\n\n\n\n################################################################################" echo "#   #" echo "# Mise à jour de la liste des plugins #" echo "#  #" echo "################################################################################" svnPlugin echo -e "\n\n\n\n\n\n################################################################################" echo "#   #" echo "# Opérations de mise à jours #" echo "#  #" echo "################################################################################" echo "" echo -e "\n### Mise à jour de la base de données ###" updateDB echo -e "\n\n### Vidage du cache ###" cleanCache