r52044 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52043‎ | r52044 | r52045 >
Date:11:05, 17 June 2009
Author:gerardm
Status:deferred
Tags:
Comment:
Maintain pre-defined environments
Modified paths:
  • /trunk/testing/util/environment/Environment (added) (history)
  • /trunk/testing/util/environment/Environment_install.sh (added) (history)
  • /trunk/testing/util/environment/Ext_Update.sh (added) (history)

Diff [purge]

Index: trunk/testing/util/environment/Environment_install.sh
@@ -0,0 +1,126 @@
 2+#!/bin/sh
 3+# (c) Gerard Meijssen - MIT licence
 4+
 5+# make sense of the input parameters
 6+Environment=$1
 7+SystemShort=$2
 8+Tag=$3
 9+Revision=$4
 10+Languages=$5
 11+
 12+# additional parameters
 13+declare -i Count=0
 14+
 15+
 16+# At least five parameters are needed for this program
 17+if [ $# -lt 5 ]
 18+then
 19+ echo The Environment, the System name, a Revision, a Tag and at least one language code are expected as parameter
 20+ exit
 21+fi
 22+
 23+#Goto the directory of the installer
 24+cd ../../installer
 25+
 26+# retrieve the values in the Environment file
 27+while read line
 28+do
 29+ set -- $line
 30+ if [ $1 == $Environment ]
 31+ then
 32+ FileTag=$2
 33+ FileRevision=$3
 34+ fi
 35+
 36+done < ../util/environment/Environment
 37+
 38+# replace "default" with values from the Environment file
 39+if [ ${Tag} = "default" ]
 40+then
 41+ Tag=$FileTag
 42+else
 43+ if ./installer.py mediawiki:${Tag} | grep ${Revision} ; then echo "${Tag} found"; else exit; fi
 44+fi
 45+if [ ${Revision} = "default" ]
 46+then
 47+ Revision=${FileRevision}
 48+else
 49+ if ./installer.py revision.mediawiki:${Revision} | grep ${Revision} ; then echo "${Revision} found"; else exit; fi
 50+fi
 51+
 52+if [ $Tag == "-" ]
 53+then
 54+ InstallString=" revision ${Revision} "
 55+else
 56+ InstallString="${Tag} "
 57+fi
 58+
 59+#When multiple languages have been defined, an installation has to be created for each of them
 60+for Language in $Languages
 61+do
 62+ if [ "$Languages" == "none" ]
 63+ then
 64+ System=${SystemShort}
 65+ Language="en"
 66+ else
 67+ System="${Language}_${SystemShort}"
 68+ fi
 69+
 70+ ((Count=${Count}+1))
 71+
 72+ if [ ${Count} = 1 ]
 73+ then
 74+ System1=${System}
 75+
 76+ # uninstall and install the system
 77+ if [ -s ../../public_html/revisions/${System} ]
 78+ then
 79+ ./installer.py uninstall mediawiki:${System}
 80+ grep -v ${System} ../util/environment/InstalledEnvSystems > ../util/environment/TMP_InstalledEnvSystems
 81+ mv ../util/environment/TMP_InstalledEnvSystems ../util/environment/InstalledEnvSystems
 82+ fi
 83+ ./installer.py install mediawiki:${InstallString} language ${Language} as ${System}
 84+ echo "${Environment} ${System}" >> ../util/environment/InstalledEnvSystems
 85+
 86+ # install the extensions mentioned in the Env_Extensions file
 87+ while read line
 88+ do
 89+ set -- $line
 90+ if [ $1 == $Environment ]
 91+ then
 92+ # check if there are three variables
 93+ if [ $# -lt 3 ]
 94+ then
 95+ ./installer.py install extension:$2 in $System
 96+ else
 97+ ./installer.py install extension:$2 revision $3 in $System
 98+ fi
 99+ fi
 100+
 101+ done < ../util/environment/Env_Extensions
 102+
 103+ # run the configuration program for the Envirionment
 104+ if [ -s ../util/environment/${Environment}/${Environment}.sh ]
 105+ then
 106+ ./../util/environment/${Environment}/${Environment}.sh ${System}
 107+ fi
 108+
 109+ # run the maintenance update (makes sense to run this after an install or update
 110+ php ../../public_html/revisions/${System}/maintenance/update.php
 111+
 112+ # run the LocalisationUpdate if it is installed
 113+ if [ -s ../../public_html/revisions/${System}/extensions/LocalisationUpdate/update.php ]
 114+ then
 115+ php ../../public_html/revisions/${System}/extensions/LocalisationUpdate/update.php
 116+ fi
 117+
 118+ else # Count is not 1
 119+
 120+ # duplication of a system is much faster
 121+ ./installer.py uninstall ${System}
 122+ grep -v ${System} ../util/environment/InstalledEnvSystems > ../util/environment/TMP_InstalledEnvSystems
 123+ mv ../util/environment/TMP_InstalledEnvSystems ../util/environment/InstalledEnvSystems
 124+ ./installer.py duplicate ${System1} ${System} language ${Language}
 125+ echo "${Environment} ${System}" >> ../util/environment/InstalledEnvSystems
 126+ fi
 127+done
Property changes on: trunk/testing/util/environment/Environment_install.sh
___________________________________________________________________
Name: svn:executable
1128 + *
Index: trunk/testing/util/environment/Environment
@@ -0,0 +1,6 @@
 2+MetavidWiki - 48941
 3+Referata REL1_15_0 -
 4+Uniwiki REL1_13_3 -
 5+WikiEducator - 48811
 6+Wikipedia - 50605
 7+Usability - 51998
Index: trunk/testing/util/environment/Ext_Update.sh
@@ -0,0 +1,51 @@
 2+#!/bin/sh
 3+# (c) Gerard Meijssen - MIT licence
 4+
 5+# At least five parameters are needed for this program
 6+if [ $# -lt 1 ]
 7+then
 8+ echo The Environment is a mandatory parameter, the revision is eligible, latest being recognised
 9+exit
 10+fi
 11+
 12+Environment=${1}
 13+ParmRevision=${2}
 14+
 15+# find the systems that have been installed using an environment
 16+while read line
 17+do
 18+ set -- ${line}
 19+ if [ ${1} == ${Environment} ]
 20+ then
 21+ System=${2}
 22+
 23+ # install the extensions mentioned in the Env_Extensions file
 24+ while read EnvExtension
 25+ do
 26+ set -- ${EnvExtension}
 27+ if [ $1 == ${Environment} ]
 28+ then
 29+ Extension=$2
 30+ cd ../../../public_html/revisions/${System}/extensions/${Extension}
 31+ CurrentRevision=`svn info | grep Revision | awk '{print $2}'`
 32+ # check if there are three variables
 33+ if [ ${#} -lt 3 ] || [ "${ParmRevison}" == "latest" ]
 34+ then
 35+ svn update
 36+ else
 37+ Revision=$3
 38+ svn update -r${Revision}
 39+ fi
 40+
 41+ cd ../../../../../testing/util/environment
 42+ fi
 43+
 44+ done < Env_Extensions
 45+
 46+ # run the maintenance update (makes sense to run this after an install or update
 47+ cd ../../../public_html/revisions/${System}/maintenance
 48+ php update.php
 49+ cd ../../../../testing/util/environment
 50+
 51+ fi
 52+done < InstalledEnvSystems
Property changes on: trunk/testing/util/environment/Ext_Update.sh
___________________________________________________________________
Name: svn:executable
153 + *

Status & tagging log