Skip to content

Instantly share code, notes, and snippets.

@kartikm
Last active July 23, 2019 11:27
Show Gist options
  • Save kartikm/3a8c9be6d2b1bb9f9a7b1feef652409c to your computer and use it in GitHub Desktop.
Save kartikm/3a8c9be6d2b1bb9f9a7b1feef652409c to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Download MLEB tarball for testing and put into /MediaWiki and run this script from there."
echo "Enter MLEB version. eg. 2019.07"
read -r MLEBV
echo "Enter tag for MediaWiki (or master): "
read -r MWTAG
echo "Enter location of MediaWiki core: "
read -r MWCORE
#Remove old extensions files if any
rm -rf /MediaWiki/mleb/extensions/*
rm -rf "$MWCORE"/extensions/*
tar -xvjf MediaWikiLanguageExtensionBundle-$MLEBV.tar.bz2
#Copy MLEB to both locations
cp -r extensions/* /MediaWiki/mleb/extensions
cp -r extensions/* "$MWCORE"/extensions
#Cleanup after installation is done, keep tarball for future use.
rm -rf extensions
rm -f INSTALL.MediaWikiLanguageExtensionBundle
cd "$MWCORE" || exit
if [ "$MWTAG" = "master" ];
then
git checkout master
git reset --hard origin/master
git pull
composer update --no-dev
cd "skins/Vector" || exit
git pull
php "$MWCORE"/maintainance/update.php --quick
echo "MediaWiki is updated to master."
else
git checkout master
git reset --hard origin/master
git pull
git branch -D "$MWTAG"
git checkout -b "$MWTAG" "$MWTAG"
composer update --no-dev
php "$MWCORE"/maintainance/update.php --quick
cd "skins/Vector" || exit
git checkout master
git reset --hard origin/master
git pull
git branch -D "$MWTAG"
git checkout -b "$MWTAG" "$MWTAG"
php "$MWCORE"/maintenance/update.php --quick
echo "MediaWiki is updated to $MWTAG."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment