Projet

Général

Profil

Révision 3e00cc24

Ajouté par Julien Enselme il y a environ 10 ans

Add possibility for a config file

Voir les différences:

.gitignore
11 11
tmp/*
12 12
Desktop/*
13 13
drush-backups
14
d7-sync-config.sh
14 15
.*
15 16

  
16 17
# Ignore Eclipse's files.
other-scripts/d7-sync-config.example.sh
1
# Example file for d7-sync.sh.  Adapt to your own needs in d7-sync-config.sh
2

  
3
DIR_MULTIASSOS=/home/jenselme/Documents/assos/drupal
4
DIR_DRUPAL7=$DIR_MULTIASSOS/drupal7
5
DIR_DRUPAL7_SITES=$DIR_DRUPAL7/sites
6
LOCAL_BRANCH_NAME=local
7
DOMAIN=assos.local
other-scripts/d7-sync.sh
11 11
You must launch this script at the root of the drupal instance.
12 12
EOF
13 13

  
14
### Init
15
# Config
16
source d7-sync-config.sh || source d7-sync-config.example.sh
17
cd $DIR_MULTIASSOS
18
ret=$?
19
if [ $ret -ne 0 ] ; then
20
    echo "No config file. Exiting."
21
    exit 2
22
fi
14 23
### sync drupal tree
15 24
git pull --rebase
16 25

  
......
19 28
    exit 0
20 29
fi
21 30

  
22
root=$(pwd)
23
cd drupal7/sites
24

  
25
ret=$?
26
if [ $ret -ne 0 ] ; then
27
    echo 'Not in the right directory. Exiting.'
28
    exit 1
29
fi
31
cd $DIR_DRUPAL7_SITES
30 32

  
31 33
if [ $1 = default ] ; then
32 34
    dir_site=$1
......
60 62
ssh assos "rm $remote_sql_file"
61 63

  
62 64
### modify settings.php
63
python3 $root/other-scripts/modify-settings.py settings.local.php --baseurl assos.local/$1
65
if [ $1 = 'default' ] ; then
66
    base_url=$DOMAIN
67
else
68
    base_url=$DOMAIN/$1
69
fi
70
python3 $DIR_MULTIASSOS/other-scripts/modify-settings.py settings.local.php --baseurl $base_url
64 71

  
65 72
### various drush cmd to finish synchronisation
66 73
drush status > /dev/null

Formats disponibles : Unified diff