Subversion Repositories eFlore/Applications.coel

Compare Revisions

No changes between revisions

Ignore whitespace Rev 1414 → Rev 1415

/trunk/mise_en_ligne.sh
New file
0,0 → 1,73
#!/bin/bash
########################################################################################################################
# But : mise en ligne automatique sur le serveur par ftp, de la dernière version de COEL
# Auteur : Jean-Pascal Milcent <jpm@tela-botanica.org> (translate bat file to shell script)
# License : GPL v3
# Création : 11 janvier 2010
# Version: 0.1
# $Id$
########################################################################################################################
# Constante
APPDIR=`dirname $0`;
NBREPARAM=$#
APPLI_NOM="Coel"
FICHIER_COMPILATION="$APPLI_NOM-compile"
DOSSIER_COMPILATION="$APPDIR/war"
DOSSIER_DESTINATION="/www/eflore/coel"
DOSSIER_JREST="$APPDIR/../jrest"
DOSSIER_JREST_DESTINATION="/www/eflore/coel/jrest"
APPLI_SERVICE_BASE_URL="http://www.tela-botanica.org/eflore/coel/jrest/"
 
# Aide
E_OPTERR=65
if [ "$1" = '--help' ]
then # Le script a besoin d'au moins un argument sur la ligne de commande
echo "Usage $0 -[parameters -u, -p ]"
echo "Paramétres : "
echo " -h: indiquer l'hote ftp"
echo " -u: indiquer le nom de l'utilisateur ftp"
echo " -p: indiquer le mot de passe de l'utilisateur ftp"
exit $E_OPTERR
fi
 
# Récupération des paramètres et des options de la ligne de commande
TEMP=`getopt -o u:p:h: -l help: -- "$@"`
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$TEMP"
while [ ! -z "$1" ] ; do
#echo $1" # "$2
case "$1" in
-h) HOST=$2;;
-u) FTP_USER=$2;;
-p) FTP_PASSWD=$2;;
--) shift ; break ;;
*) echo "Internal error!" ; exit 1 ;;
esac
shift 2
done
 
# Nous devons être dans le dossier de ce script pour que tout fonctionne
echo "Vérification que tout est en place pour la mise en ligne : ";
if [ -d $DOSSIER_COMPILATION ]; then
echo "OK : dossier de compilation '$DOSSIER_COMPILATION' existe";
else
echo "KO : dossier de compilation '$DOSSIER_COMPILATION' inexistant!";
fi;
if [ -f ./$FICHIER_COMPILATION ]; then
echo "OK : fichier de compilation $FICHIER_COMPILATION existe";
else
echo "KO : fichier de compilation $FICHIER_COMPILATION inexistant!";
fi;
 
if [ $NBREPARAM -eq 0 ]; then
echo "Pas de transfert sur le serveur. Utiliser --help pour voir les options de transfert."
else
echo "Compilation de l'application : ";
./$FICHIER_COMPILATION
echo "Transfert sur le serveur de l'application :";
lftp ftp://$FTP_USER:$FTP_PASSWD@$HOST -e "set ftp:passive off; mirror -e -R -L -x .svn -x WEB-INF -x .htaccess -x config.js -x jrest $DOSSIER_COMPILATION $DOSSIER_DESTINATION ; quit"
echo "Transfert sur le serveur de Jrest :";
lftp ftp://$FTP_USER:$FTP_PASSWD@$HOST -e "set ftp:passive off; mirror -e -R -x .svn -x jrest.ini.php -x .htaccess -x .project -x .buildpath -x .settings $DOSSIER_JREST $DOSSIER_JREST_DESTINATION ; quit"
fi;
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
Added: svn:executable
+*
\ No newline at end of property