Skip to content
Snippets Groups Projects
Select Git revision
  • f77dd2041b7858eadf9fc6cd5701e4802779601c
  • master default protected
  • alc-scindage-donnees-pj
  • b24
  • ll-workflow
  • 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

EntityServiceFactory.php

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    deploy.sh 2.86 KiB
    #!/usr/bin/env bash
    
    ########################################################################
    # Synchronise le répertoire courant avec celui spécifié en argument,
    # à l'aide de l'outil 'rsync'.
    # Une simple simulation peut être faite.
    #
    # NB: Des fichiers peuvent être exclus de la synchro.
    ########################################################################
    
    EXCLUSIONS=""
    EXCLUSIONS="$EXCLUSIONS --exclude auth.json"
    EXCLUSIONS="$EXCLUSIONS --exclude /public/.htaccess"
    EXCLUSIONS="$EXCLUSIONS --exclude /docs/*"
    EXCLUSIONS="$EXCLUSIONS --exclude /logs/*"
    EXCLUSIONS="$EXCLUSIONS --exclude /tests"
    EXCLUSIONS="$EXCLUSIONS --exclude *~"
    EXCLUSIONS="$EXCLUSIONS --exclude .svn/"
    EXCLUSIONS="$EXCLUSIONS --exclude .git/"
    EXCLUSIONS="$EXCLUSIONS --exclude /composer.lock"
    EXCLUSIONS="$EXCLUSIONS --exclude /*.log"
    #EXCLUSIONS="$EXCLUSIONS --exclude /vendor/*"
    EXCLUSIONS="$EXCLUSIONS --exclude /config/*local.php"
    EXCLUSIONS="$EXCLUSIONS --exclude /data/cache/*"
    EXCLUSIONS="$EXCLUSIONS --exclude /config/autoload/*local.php"
    EXCLUSIONS="$EXCLUSIONS --exclude /temp/*"
    
    LOG_FILE='./deploy.log'
    
    # Execute getopt
    ARGS=`getopt -o "t:s:" -l "target:,simulation:" -n "getopt.sh" -- "$@"`
    
    # Bad arguments
    if [ $? -ne 0 ];
    then
      exit 1
    fi
    
    # A little magic
    eval set -- "$ARGS"
    
    # Now go through all the options
    while true;
    do
      case "$1" in
        -t|--target)
        #--------------
          if [ -n "$2" ];
          then
            echo "Target : $2"
            target="$2"
          fi
          shift 2;;
    
        -s|--simulation)
        #---------------
          if [ -n "$2" ];
          then
            echo "Simulation : $2"
            simul=$2
          fi
          shift 2;;
    
        --)
          shift
          break;;
      esac
    done
    
    if [ ! $target ]; then
        echo "Target (ex: gauthierb@dev.unicaen.fr:/var/www/closer) ?"
        read target
    fi
    if [ ! $simul ]; then
        echo "Simulation (y/n) ? "
        read simul
    fi
    
    sourceDir="."
    doit="y"
    
    echo
    echo "------------------------------------------------------------------------------------------------------"
    echo "S Y N C H R O N I S A T I O N"
    echo "------------------------------------------------------------------------------------------------------"
    
    targetDir=$target
    
    echo "Source directory : $sourceDir"
    echo "Target directory : $target"
    
    # simulation
    if [ $simul = "y" ]; then
    	echo
    	echo "SIMULATION :"
    	echo "------------"
    	rsync -avzn --perms --delete $EXCLUSIONS -e ssh $sourceDir $targetDir
            exit
    fi
    
    # logging
    ts=`date +%d/%m/%Y-%H:%M:%S`
    echo "------------------------------------------------------------------------------------------------------" >> $LOG_FILE
    echo "$ts : $0 $*" >> $LOG_FILE
    
    # synchronisation
    if [ $doit = "y" ]; then
    	echo
    	echo "SYNCHRONISATION :"
    	echo "-----------------"
    	rsync -avz --perms --delete $EXCLUSIONS -e ssh --log-file=$LOG_FILE $sourceDir $targetDir
    fi
    
    echo "------------------------------------------------------------------------------------------------------"
    echo