Page MenuHomeDevCentral

mw-update
No OneTemporary

mw-update

#!/bin/sh
# -------------------------------------------------------------
# MediaWiki :: update core
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Description: Update core and reapply kludge to load ext/skins
# License: BSD-2-Clause
# Source file: roles/devserver/userland-home/files/dereckson/bin/mw-update
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
set -e
rootdir=/var/51-wwwroot/mediawiki-dereckson
cd $rootdir/core
# -------------------------------------------------------------
# Ensure we're in the default branch
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
DEFAULT_BRANCH=$(git get-default-branch)
if [ "$CURRENT_BRANCH" != "$DEFAULT_BRANCH" ]; then
echo "You need to switch to the $DEFAULT_BRANCH branch to update MediaWiki." >&2
exit 1
fi
# -------------------------------------------------------------
# Unlink symlinks and stash
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
rm extensions skins
git stash
# -------------------------------------------------------------
# Update
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
git pull
# -------------------------------------------------------------
# Relink
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
rm -rf extensions skins
ln -s ../extensions .
ln -s ../skins .
# -------------------------------------------------------------
# Try auto-update
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
composer update
(cd maintenance && php run.php update.php)
# -------------------------------------------------------------
# Present next steps
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
git stash show

File Metadata

Mime Type
text/x-shellscript
Expires
Sat, Nov 7, 03:05 (12 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4207263
Default Alt Text
mw-update (2 KB)

Event Timeline