-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrebuild.sh
More file actions
executable file
·61 lines (53 loc) · 1.66 KB
/
rebuild.sh
File metadata and controls
executable file
·61 lines (53 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
BASEDIR=`php -r "echo dirname(realpath('$0'));"`
OLDDIR=`pwd`
cd $BASEDIR
# Create backup directories, if they don't exist yet.
mkdir -p bak_contrib/{modules,themes}
# Move all things about to get rebuild to backup directory.
for contrib in modules/contrib modules/development themes/contrib libraries translations
do
mv -f $contrib bak_contrib/$contrib
done
# Result of last tried operation, also used as flag for skipping subsequent steps.
LAST_RETURN_VALUE=0
# Run drush make
if [ $LAST_RETURN_VALUE -eq 0 ]; then
drush make --yes --working-copy --no-core --contrib-destination=. --translations=fr multilang.make
LAST_RETURN_VALUE=$?
if [ $LAST_RETURN_VALUE -ne 0 ]; then
echo "There was a problem with drush make."
fi
fi
# step 2
if [ $LAST_RETURN_VALUE -eq 0 ]; then
./copy_and_patch_locally.sh
LAST_RETURN_VALUE=$?
if [ $LAST_RETURN_VALUE -ne 0 ]; then
echo "There was a problem with local patches."
fi
fi
# Decide whether to roll back or not.
if [ $LAST_RETURN_VALUE -eq 0 ]; then
echo "Everything was fine in $0"
rm -rf bak_contrib
echo "Contrib backups deleted."
else
echo "There was a problem."
# Things went wrong - back-up from bak_contrib
if [ -n `which rsync` ]; then
rsync -av bak_contrib/ .
LAST_RETURN_VALUE=$?
if [ $LAST_RETURN_VALUE -eq 0 ]; then
rm -rf bak_contrib
echo "Contrib backups have been rolled back."
else
echo "There was a problem during roll back. Backups have been left intact."
fi
fi
fi
# sync DB to new code, but no auto-confirmation commandline switch ( "--yes" )
# in order to leave the choice to the user.
// drush updb
# Go back where we came from.
cd $OLDDIR