Projet

Général

Profil

Paste
Télécharger (1,41 ko) Statistiques
| Branche: | Révision:

root / bin / d7-all-update-core.sh @ d808fa20

1 800a00f1 Julien Enselme
#!/bin/sh
2
3 15ed27d8 Julien Enselme
usage() {
4
    printf "This script is intended to help you update drupal core. It follows steps described here: https://forge.centrale-marseille.fr/projects/clubdrupal/wiki/Utilisation_de_Drupal_multi-site#Mise-à-jour-du-noyau-de-Drupal
5
Please do not launch in cron.\n"
6
}
7
. /home/assos/bin/print-help-if-required.sh
8
9 3ae9d44b Julien Enselme
10 15ed27d8 Julien Enselme
. /home/assos/bin/scripts-config.sh
11 800a00f1 Julien Enselme
12
if ! tty -s ; then
13 3e9236bd Julien Enselme
    echo "${help}"
14 800a00f1 Julien Enselme
    exit 1
15
fi
16
17
set -e # Exit immediatly if a command exits with a non zero value
18
19 943cf374 Florent Torregrosa
# Backup translations
20 3ae9d44b Julien Enselme
translations_backupdir=/var/tmp
21 3e9236bd Julien Enselme
cp "${translations_fr}" "${translations_backupdir}"
22 800a00f1 Julien Enselme
23 15ed27d8 Julien Enselme
d7-all-dump-individual.sh -m manual
24 800a00f1 Julien Enselme
25
d7-all-drush.sh -y en update
26
27 3e9236bd Julien Enselme
cd "${d7_dir}"
28 d05743f7 Julien Enselme
drush -y upc drupal
29 800a00f1 Julien Enselme
30 2aea68ab Julien Enselme
d7-all-drush.sh -y updb
31 800a00f1 Julien Enselme
32
d7-all-drush.sh -y dis update
33
34
# Get the new subversion number:
35
# cd to $d7_dir, filter drush status to get the drupal version line,
36
# remove end line whitespaces, and get the 2 last caracters of the string.
37 8550e097 Julien Enselme
drupal_version=$(cd "${d7_dir}" && drush status | grep "Drupal version" | tr -d ' ' | tail -c 3)
38 800a00f1 Julien Enselme
39
# Try to download new translation. If it fails, restore the old one.
40 3e9236bd Julien Enselme
if ! curl -f "http://ftp.drupal.org/files/translations/7.x/drupal/drupal-7.${drupal_version}.fr.po" -o "${translations_fr}" ; then
41
    cp "${translations_backupdir}/fr.po" "${translations_fr}"
42 800a00f1 Julien Enselme
fi
43
44
echo "Check for settings.php update."
45
echo "If everything is fine, run:"
46 3e9236bd Julien Enselme
echo -e "\tgit add -A drupal7 && git commit -m 'Udpate to 7.${drupal_version}'"