Révision 800a00f1
Ajouté par Julien Enselme il y a presque 10 ans
bin/d7-update-core.sh | ||
---|---|---|
1 |
#!/bin/sh |
|
2 |
|
|
3 |
help="This script is intended to help you update drupal core. It fellows steps describe here: https://forge.centrale-marseille.fr/projects/clubdrupal/wiki/Utilisation_de_Drupal_multi-site#Mise-%C3%A0-jour-du-noyau-de-Drupal |
|
4 |
Please do not launch in cron." |
|
5 |
|
|
6 |
if ! tty -s ; then |
|
7 |
echo $help |
|
8 |
exit 1 |
|
9 |
fi |
|
10 |
|
|
11 |
set -e # Exit immediatly if a command exits with a non zero value |
|
12 |
|
|
13 |
# Backup transaltion |
|
14 |
$translations_backupdir=/var/tmp |
|
15 |
cp $translations_fr $translations_backupdir |
|
16 |
|
|
17 |
d7-all-dump-individual.sh manual |
|
18 |
|
|
19 |
d7-all-update-contrib.sh |
|
20 |
|
|
21 |
d7-all-drush.sh -y en update |
|
22 |
|
|
23 |
d7-all-drush.sh -y upc drupal |
|
24 |
|
|
25 |
d7-all-drush.sh updb |
|
26 |
|
|
27 |
d7-all-drush.sh -y dis update |
|
28 |
|
|
29 |
# Get the new subversion number: |
|
30 |
# cd to $d7_dir, filter drush status to get the drupal version line, |
|
31 |
# remove end line whitespaces, and get the 2 last caracters of the string. |
|
32 |
drupal_version=$(cd $d7_dir && drush status | grep "Drupal version" | tr -d ' ' | tail -c 3) |
|
33 |
|
|
34 |
# Try to download new translation. If it fails, restore the old one. |
|
35 |
if ! curl -f http://ftp.drupal.org/files/translations/7.x/drupal/drupal-7.28.fr.po -o $translations_fr ; then |
|
36 |
cp $translations_backupdir/fr.po $translations_fr |
|
37 |
fi |
|
38 |
|
|
39 |
echo "Check for settings.php update." |
|
40 |
echo "If everything is fine, run:" |
|
41 |
echo -e "\tgit add -A drupal7 && git commit -m 'Udpate to 7.$drupal_version'" |
Formats disponibles : Unified diff
Add script to help the update of drupal core.