Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/90083
Change subject: Use standard env var names for MW_COMMON / MW_COMMON_SOURCE dirs
......................................................................
Use standard env var names for MW_COMMON / MW_COMMON_SOURCE dirs
Replace $commonHomeDir / $commonLocalDir vars with MW_COMMON / MW_COMMON_SOURCE
constants, for consistency with deployment scripts, and try to get their value
from the shell environment, falling back to current hard-coded values.
Change-Id: I3f390c4c3bafa1a349411b9bf52955f8b58212e1
---
M multiversion/checkoutMediaWiki
1 file changed, 18 insertions(+), 17 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config
refs/changes/83/90083/1
diff --git a/multiversion/checkoutMediaWiki b/multiversion/checkoutMediaWiki
index d84e1ae..1a73a4b 100755
--- a/multiversion/checkoutMediaWiki
+++ b/multiversion/checkoutMediaWiki
@@ -2,6 +2,9 @@
<?php
error_reporting( E_ALL );
+define( 'MW_COMMON_SOURCE', getenv( 'MW_COMMON_SOURCE' ) ?: '/a/common' );
+define( 'MW_COMMON', getenv( 'MW_COMMON' ) ?: '/usr/local/apache/common-local'
);
+
/**
* Automatically git clone a MediaWiki version and do some basic wmf setup.
* LocalSettings.php will be created (which loads CommonSettings.php) and
various
@@ -19,8 +22,6 @@
*/
function checkoutMediaWiki() {
global $argv;
- $commonHomeDir = '/a/common';
- $commonLocalDir = '/usr/local/apache/common-local';
$argsValid = false;
if ( count( $argv ) >= 3 ) {
@@ -37,7 +38,7 @@
}
# MW install path
- $destIP = "$commonHomeDir/$dstVersion";
+ $destIP = MW_COMMON_SOURCE . "/$dstVersion";
if ( !file_exists( $destIP ) ) {
passthru( 'git clone -n ' .
@@ -106,37 +107,37 @@
createSymlink( $path, $link, "Created StartProfiler.php symlink." );
# Create static- symlinks for bits.wikimedia.org...
- $bitsStaticDir = "$commonHomeDir/docroot/bits/static-$dstVersionNum";
+ $bitsStaticDir = MW_COMMON_SOURCE .
"/docroot/bits/static-$dstVersionNum";
if ( !file_exists( $bitsStaticDir ) ) {
mkdir( $bitsStaticDir, 0775 );
}
- $path = "$commonHomeDir/docroot/bits/static-$dstVersionNum/skins";
- $link = "$commonLocalDir/php-$dstVersionNum/skins/";
+ $path = MW_COMMON_SOURCE . "/docroot/bits/static-$dstVersionNum/skins";
+ $link = MW_COMMON . "/php-$dstVersionNum/skins/";
createSymlink( $path, $link, "Created bits/static-$dstVersionNum/skins
symlink." );
- $path = "$commonHomeDir/docroot/bits/static-$dstVersionNum/extensions";
- $link = "$commonLocalDir/php-$dstVersionNum/extensions";
+ $path = MW_COMMON_SOURCE .
"/docroot/bits/static-$dstVersionNum/extensions";
+ $link = MW_COMMON . "/php-$dstVersionNum/extensions";
createSymlink( $path, $link, "Created
bits/static-$dstVersionNum/extensions symlink." );
- $path = "$commonHomeDir/docroot/bits/static-$dstVersionNum/resources";
- $link = "$commonLocalDir/php-$dstVersionNum/resources";
+ $path = MW_COMMON_SOURCE .
"/docroot/bits/static-$dstVersionNum/resources";
+ $link = MW_COMMON . "/php-$dstVersionNum/resources";
createSymlink( $path, $link, "Created
bits/static-$dstVersionNum/resources symlink." );
# Create static- symlinks for /w...
- $liveStaticDir = "$commonHomeDir/w/static-$dstVersionNum";
+ $liveStaticDir = MW_COMMON_SOURCE . "/w/static-$dstVersionNum";
if ( !file_exists( $liveStaticDir ) ) {
mkdir( $liveStaticDir, 0775 );
}
- $path = "$commonHomeDir/w/static-$dstVersionNum/skins";
- $link = "$commonLocalDir/php-$dstVersionNum/skins";
+ $path = MW_COMMON_SOURCE . "/w/static-$dstVersionNum/skins";
+ $link = MW_COMMON . "/php-$dstVersionNum/skins";
createSymlink( $path, $link, "Created /w/static-$dstVersionNum/skins
symlink." );
- $path = "$commonHomeDir/w/static-$dstVersionNum/extensions";
- $link = "$commonLocalDir/php-$dstVersionNum/extensions";
+ $path = MW_COMMON_SOURCE . "/w/static-$dstVersionNum/extensions";
+ $link = MW_COMMON . "/php-$dstVersionNum/extensions";
createSymlink( $path, $link, "Created
/w/static-$dstVersionNum/extensions symlink." );
- $path = "$commonHomeDir/w/static-$dstVersionNum/resources";
- $link = "$commonLocalDir/php-$dstVersionNum/resources";
+ $path = MW_COMMON_SOURCE . "/w/static-$dstVersionNum/resources";
+ $link = MW_COMMON . "/php-$dstVersionNum/resources";
createSymlink( $path, $link, "Created
/w/static-$dstVersionNum/resources symlink." );
# Create l10n cache dir
--
To view, visit https://gerrit.wikimedia.org/r/90083
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f390c4c3bafa1a349411b9bf52955f8b58212e1
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits