Projet

Général

Profil

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

root / bin / d7-all-update-core.sh @ 8550e097

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