Skip to content
Snippets Groups Projects
Select Git revision
  • e20761d7cafa320c55a37cad5638a348310a984f
  • master default protected
  • b24
  • ll-workflow
  • alc-scindage-donnees-pj
  • FJ_LL_Tbl_Contrat
  • alc-docker-node
  • ll-apiplatform
  • php84
  • ll-rgpd
  • b23
  • alc-filtre-type-intervenant
  • ll-sans-mdb5
  • formules-ancienne-infra
  • ll-formules
  • alc-intervenant-dmep
  • ll-suppr-v_vol-s
  • b20
  • ll-postgresql
  • b23.0.1
  • b22
  • 24.8
  • 24.7
  • 24.6
  • 24.5
  • 24.4
  • 24.3
  • 24.2
  • 24.1
  • 24.0
  • 23.15
  • 24.0-beta19
  • 24.0-beta18
  • 24.0-beta17
  • 24.0-beta16
  • 24.0-beta15
  • 24.0-beta14
  • 24.0-beta13
  • 23.14
  • 24.0-beta12
  • 24.0-beta11
41 results

install.sql

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    deploy.sh 2.38 KiB
    #/bin/bash
    
    ########################################################################
    # Synchronise le répertoire courant avec celui spécifié en argument.
    # Une simple simulation peut etre faite.
    #
    # Les fichiers à exclure sont listés dans un fichier à part.
    ########################################################################
    
    EXCLUSIONS="--exclude /docs/* --exclude /logs/* --exclude /tests --exclude *~ --exclude .svn/ --exclude .git/"
    EXCLUSIONS="$EXCLUSIONS --exclude /config/autoload/*local.php"
    EXCLUSIONS="$EXCLUSIONS --exclude /temp/*"
    
    LOG_FILE='./deploy.log'
    
    echo "Nom du répertoire sur le serveur ? "
    read appName
    
    dev="gauthierb@dev.unicaen.fr:/var/www/$appName/"
    prod="gauthierb@lgest1.unicaen.fr:/var/www/html/$appName/"
    
    sourceDir="."
    simul="o"
    doit="o"
    
    echo
    echo "------------------------------------------------------------------------------------------------------"
    echo "S Y N C H R O N I S A T I O N"
    echo "------------------------------------------------------------------------------------------------------"
    
    echo "Répertoire source : $sourceDir"
    
    if [ $1 -a $1 = "nosim" ]; then
    	simul="n"
    	targetDir=$2
    else
    	if [ $2 -a $2 = "nosim" ]; then
    		simul="n"
    	fi
    	targetDir=$1
    fi
    
    # répertoire cible
    if [ ! $targetDir ]; then
    	echo "La cible (dev ou prod), svp ? "
    	read targetDir
    fi
    
    if [ $targetDir = "dev" ]; then
        targetDir=$dev
    else
        if [ $targetDir = "prod" ]; then
            targetDir=$prod
        else
            echo "Répertoire cible inconnu!"
            echo "------------------------------------------------------------------------------------------------------"
            echo
            exit
        fi
    fi
    
    echo "Répertoire cible  : $targetDir"
    
    # simulation préalable
    if [ $simul = "o" ]; then
    	echo
    	echo "SIMULATION :"
    	echo "------------"
    	rsync -avzn --perms --delete $EXCLUSIONS -e ssh $sourceDir $targetDir
    
    	echo
    	echo -n "Procéder à la synchronisation ? (o/n) "
    	read doit
    fi
    
    # logging
    ts=`date +%d/%m/%Y-%H:%M:%S`
    echo "------------------------------------------------------------------------------------------------------" >> $LOG_FILE
    echo "$ts : $0 $*" >> $LOG_FILE
    
    # synchronisation
    if [ $doit = "o" ]; then
    	echo
    	echo "SYNCHRONISATION :"
    	echo "-----------------"
    	rsync -avz --perms --delete $EXCLUSIONS -e ssh --log-file=$LOG_FILE $sourceDir $targetDir
    fi
    
    echo "------------------------------------------------------------------------------------------------------"
    echo