Created
June 18, 2019 12:48
-
-
Save kartikm/de7f4015b687b4fc9bdc87bf63773d2f to your computer and use it in GitHub Desktop.
Update MediaWiki installation easily
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
MY_MW=/var/www/core | |
#Update vendor | |
cd $MY_MW/vendor | |
composer update | |
#Core | |
cd $MY_MW | |
git checkout master | |
git reset --hard origin/master | |
git pull | |
composer update | |
echo "Updated core to latest master" | |
#Update vector skin | |
cd $MY_MW/skins/Vector | |
git pull | |
echo "Updated Vector to latest master" | |
php $MY_MW/maintenance/update.php --quick | |
if [ "$1" ]; then | |
for dir in $MY_MW/extensions | |
do | |
cd "$dir" | |
git checkout master | |
git reset --hard origin/master | |
git pull | |
git branch -D "$1" | |
git checkout -b "$1" "$1" | |
done | |
echo "Extensions are updated to '$1'" | |
else | |
for dir in $MY_MW/extensions/*/ | |
do | |
cd "$dir" | |
git checkout master | |
git reset --hard origin/master | |
git pull | |
git submodule update | |
done | |
echo "Extensions are updated to master" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment