Skip to content

Instantly share code, notes, and snippets.

@kartikm
Created June 18, 2019 12:48
Show Gist options
  • Save kartikm/de7f4015b687b4fc9bdc87bf63773d2f to your computer and use it in GitHub Desktop.
Save kartikm/de7f4015b687b4fc9bdc87bf63773d2f to your computer and use it in GitHub Desktop.
Update MediaWiki installation easily
#!/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