author | ymh <ymh.work@gmail.com> |
Thu, 16 Nov 2017 15:44:36 +0100 | |
changeset 553 | 251df6cb3afa |
parent 541 | e756a8c72c3d |
child 558 | 64c4050f6a36 |
permissions | -rwxr-xr-x |
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
1 |
#!/bin/bash |
428
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
# |
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
clear |
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
TARFILE=sources.tar.gz |
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
5 |
DUMP=corpusdelaparole.sql |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
6 |
APUSER=apache |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
7 |
APGROUP=apache |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
8 |
# Variable de configuration à modifier selon vos besoins |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
9 |
######################################################### |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
10 |
ROOT=/var/www/corpusdelaparole/drupal/ |
428
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
11 |
######################################################### |
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
12 |
splashTitle() { |
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
13 |
cat <<"EOT" |
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
14 |
__ _ _____ _ _____ _ |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
15 |
/ _(_) | __ \ | | / ____| | | |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
16 |
__ _| |_ _ | | | |_ __ _ _ _ __ __ _| | | (___ ___| |_ _ _ _ __ |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
17 |
/ _` | _| | | | | | '__| | | | '_ \ / _` | | \___ \ / _ \ __| | | | '_ \ |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
18 |
| (_| | | | | | |__| | | | |_| | |_) | (_| | | ____) | __/ |_| |_| | |_) | |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
19 |
\__, |_| |_| |_____/|_| \__,_| .__/ \__,_|_| |_____/ \___|\__|\__,_| .__/ |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
20 |
__/ | | | | | |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
21 |
|___/ |_| |_| |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
22 |
|
428
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
23 |
EOT |
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
24 |
} |
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
25 |
|
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
26 |
splashTitle |
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
27 |
export DRUSH_OPTIONS="-q" |
428
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
28 |
echo "--------------------------- PARAMETRES D'INSTALLATION -------------------------------------------------------" |
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
29 |
echo "------------ A modifier dans le fichier sites/default/settings.php au besoin --------------------------------" |
428
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
30 |
echo "-------------------------------------------------------------------------------------------------------------" |
553
251df6cb3afa
upgrade drupal with the new tresor theme
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
31 |
drush -r "$ROOT" sql-conf |
428
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
32 |
echo "-------------------------------------------------------------------------------------------------------------" |
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
33 |
echo "-------------------------------------------------------------------------------------------------------------" |
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
34 |
read -r -p "Etes-vous sur(e) de vouloir installer avec les paramètres ci dessus ? [Oui/n]" response |
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
35 |
response=${response,,} # tolower |
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
36 |
if [[ $response =~ ^(oui|o| ) ]]; then |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
37 |
# |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
38 |
echo "" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
39 |
echo "" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
40 |
echo "-------------------- Installation du site corpus de la parole -----------------------------------------------" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
41 |
echo "-------------------------------------------------------------------------------------------------------------" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
42 |
# |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
43 |
# Errors are fatal |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
44 |
# |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
45 |
set -e |
428
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
46 |
|
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
47 |
echo "" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
48 |
echo "Copie des sources et du dump SQL dans $ROOT" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
49 |
echo "-------------------------------------------" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
50 |
echo "cp $TARFILE $ROOT/$TARFILE" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
51 |
cp "$TARFILE" "$ROOT/$TARFILE" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
52 |
echo "cp $DUMP $ROOT/$TARFILE" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
53 |
cp "$DUMP" "$ROOT/$DUMP" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
54 |
echo ">> Copie effectuée avec succès" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
55 |
echo "" |
428
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
56 |
|
553
251df6cb3afa
upgrade drupal with the new tresor theme
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
57 |
cd "$ROOT" |
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
58 |
echo "Extraction des sources dans $ROOT" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
59 |
echo "---------------------------------" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
60 |
echo "tar -xf $TARFILE --strip 1" |
553
251df6cb3afa
upgrade drupal with the new tresor theme
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
61 |
tar -xf "$TARFILE" --strip 1 |
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
62 |
echo ">> Extraction effectuée avec succès" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
63 |
echo "" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
64 |
echo "" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
65 |
echo "Vidage de la base de données" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
66 |
echo "------------------------------------------------" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
67 |
echo "drush -r $ROOT sql-drop -y" |
553
251df6cb3afa
upgrade drupal with the new tresor theme
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
68 |
drush -r "$ROOT" sql-drop -y |
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
69 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
70 |
echo "" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
71 |
echo "Restauration du dump de bdd dans la base de données" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
72 |
echo "------------------------------------------------" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
73 |
echo "drush -r $ROOT sql-cli < $DUMP" |
553
251df6cb3afa
upgrade drupal with the new tresor theme
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
74 |
drush -r "$ROOT" sql-cli < $DUMP |
428
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
75 |
|
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
76 |
echo "" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
77 |
echo "Application des mises à jour de base de données si besoin" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
78 |
echo "------------------------------------------------" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
79 |
echo "drush -r $ROOT updb -y" |
553
251df6cb3afa
upgrade drupal with the new tresor theme
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
80 |
drush -r "$ROOT" updb -y |
428
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
81 |
|
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
82 |
echo "" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
83 |
echo "Vidage des tables accesslog,search_dataset,search_index,search_total,sessions,watchdog" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
84 |
echo "--------------------------------------------------------------------------------------" |
553
251df6cb3afa
upgrade drupal with the new tresor theme
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
85 |
drush -r "$ROOT" sql-query "TRUNCATE TABLE accesslog" |
251df6cb3afa
upgrade drupal with the new tresor theme
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
86 |
drush -r "$ROOT" sql-query "TRUNCATE TABLE search_dataset" |
251df6cb3afa
upgrade drupal with the new tresor theme
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
87 |
drush -r "$ROOT" sql-query "TRUNCATE TABLE search_index" |
251df6cb3afa
upgrade drupal with the new tresor theme
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
88 |
drush -r "$ROOT" sql-query "TRUNCATE TABLE search_total" |
251df6cb3afa
upgrade drupal with the new tresor theme
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
89 |
drush -r "$ROOT" sql-query "TRUNCATE TABLE sessions" |
251df6cb3afa
upgrade drupal with the new tresor theme
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
90 |
drush -r "$ROOT" sql-query "TRUNCATE TABLE watchdog" |
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
91 |
echo ">> Restauration effectuée avec succès" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
92 |
echo "" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
93 |
echo "Suppression de l'archive tar et du dump" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
94 |
echo "-----------------------------------------------------" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
95 |
rm "$ROOT/$TARFILE" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
96 |
rm "$ROOT/$DUMP" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
97 |
echo ">> Suppression effectuée avec succès" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
98 |
echo "" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
99 |
echo "Attribution des droits apache (httpd) sur les sources" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
100 |
echo "-----------------------------------------------------" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
101 |
echo "chown -R $APUSER:$APGROUP $ROOT/*" |
553
251df6cb3afa
upgrade drupal with the new tresor theme
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
102 |
chown -R $APUSER:$APGROUP "$ROOT/*" |
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
103 |
echo ">> Droits apache attribués avec succès" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
104 |
echo "" |
428
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
105 |
|
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
106 |
echo "Vidage des caches Drupal" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
107 |
echo "-----------------------------------------------------" |
553
251df6cb3afa
upgrade drupal with the new tresor theme
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
108 |
drush -r "$ROOT" cc all |
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
109 |
set -e |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
110 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
111 |
echo "" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
112 |
echo "" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
113 |
echo ">>>>>>>>>>>>>> INSTALLATION EFFECTUEE AVEC SUCCESS" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
114 |
echo "" |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
491
diff
changeset
|
115 |
echo "" |
428
76a47f714766
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
116 |
fi |