-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PHP script for extensions and skins setup (#390)
* Move skins setup to skins.yaml and add shell script for execution * Move skins setup to skins.yaml and add shell script for execution * Move skins setup to skins.yaml and add shell script for execution * Move skins setup to skins.yaml and add shell script for execution * Use php script for extensions and skins setup (earlier - shell) * Use php script for extensions and skins setup (earlier - shell) * Use php script for extensions and skins setup (earlier - shell)
- Loading branch information
1 parent
b3a87ea
commit ed9cd06
Showing
4 changed files
with
68 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Canasta YAML file for skins for MediaWiki 1.39. | ||
# Where the repository is not specified, the Wikimedia Git repository for the | ||
# skins with that name is used, and the default branch used is REL1_39. | ||
# Where the repository *is* specified, the default branch used is master. | ||
skins: | ||
- Chameleon: | ||
commit: f34a56528ada14ac07e1b03beda41f775ef27606 # v. 4.2.1 | ||
repository: https://github.com/ProfessionalWiki/chameleon | ||
- CologneBlue: | ||
commit: 4d588eb78d7e64e574f631c5897579537305437d | ||
- Modern: | ||
commit: fb6c2831b5f150e9b82d98d661710695a2d0f8f2 | ||
- Pivot: | ||
branch: v2.3.0 | ||
commit: d79af7514347eb5272936243d4013118354c85c1 | ||
- Refreshed: | ||
commit: 86f33620f25335eb62289aa18d342ff3b980d8b8 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!-- It is much easier to do parsing of YAML in PHP than in .sh; the standard way to do YAML parsing | ||
in a shell script is to call yq, but yq requires different executables for different architectures. | ||
Given that the YAML parsing is already in PHP, it seemed easier to do the whole thing in PHP rather | ||
than split the work between two scripts --> | ||
<?php | ||
|
||
$MW_HOME = getenv("MW_HOME"); | ||
$MW_VERSION = getenv("MW_VERSION"); | ||
$type = $argv[1]; | ||
$path = $argv[2]; | ||
|
||
$yamlData = yaml_parse_file($path); | ||
|
||
foreach ($yamlData[$type] as $obj) { | ||
$name = key($obj); | ||
$data = $obj[$name]; | ||
|
||
$repository = $data['repository'] ?? null; | ||
$commit = $data['commit'] ?? null; | ||
$branch = $data['branch'] ?? null; | ||
$patches = $data['patches'] ?? null; | ||
|
||
$gitCloneCmd = "git clone "; | ||
|
||
if ($repository === null) { | ||
$repository = "https://github.com/wikimedia/mediawiki-$type-$name"; | ||
if ($branch === null) { | ||
$branch = $MW_VERSION; | ||
$gitCloneCmd .= "--single-branch -b $branch "; | ||
} | ||
} | ||
|
||
$gitCloneCmd .= "$repository $MW_HOME/$type/$name"; | ||
$gitCheckoutCmd = "cd $MW_HOME/$type/$name && git checkout -q $commit"; | ||
|
||
exec($gitCloneCmd); | ||
exec($gitCheckoutCmd); | ||
|
||
if ($patches !== null) { | ||
foreach ($patches as $patch) { | ||
$gitApplyCmd = "cd $MW_HOME/$type/$name && git apply /tmp/$patch"; | ||
exec($gitApplyCmd); | ||
} | ||
} | ||
} | ||
|
||
?> |