-
Notifications
You must be signed in to change notification settings - Fork 343
/
Copy pathpocketmine-mpupdates.json
47 lines (47 loc) · 3.13 KB
/
pocketmine-mpupdates.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
[
{
"UpdateStageName": "Remove Old Files",
"UpdateSourcePlatform": "Windows",
"UpdateSource": "Executable",
"UpdateSourceData": "powershell.exe",
"UpdateSourceArgs": "-NoProfile -Command \"Set-Location -Path 'pocketmine-mp'; Write-Output 'Removing old server files'; @('PocketMine-MP.phar', './bin') | ForEach-Object { if (Test-Path \\\"$_\\\") { Remove-Item -Path \\\"$_\\\" -Recurse -Force -ErrorAction SilentlyContinue | Out-Null } }\"",
"SkipOnFailure": false
},
{
"UpdateStageName": "PHP Binary Download",
"UpdateSourcePlatform": "Windows",
"UpdateSource": "Executable",
"UpdateSourceData": "powershell.exe",
"UpdateSourceArgs": "-NoProfile -Command \"$ProgressPreference='SilentlyContinue'; $PHPVersion='{{PHPVersion}}'; if ([string]::IsNullOrWhiteSpace($PHPVersion)) { Invoke-WebRequest -UseBasicParsing -Uri ((Invoke-RestMethod -UseBasicParsing -Uri 'https://api.github.com/repos/pmmp/PHP-Binaries/releases/latest').assets | Where-Object { $_.browser_download_url -match '.*/PHP.*Windows-x64.*\\.zip$' })[0].browser_download_url -OutFile 'PHP.zip'; if ($?) { Write-Output \\\"Latest PHP Binary release version downloaded\\\"; } } elseif ($PHPVersion -notmatch '^\\d+\\.\\d+\\.\\d+$') { Write-Output \\\"Invalid PHP Binary version format specified\\\"; exit 1; } else { Invoke-WebRequest -UseBasicParsing -Uri ((Invoke-RestMethod -UseBasicParsing -Uri \"https://api.github.com/repos/pmmp/PHP-Binaries/releases/tags/$PHPVersion\").assets | Where-Object { $_.browser_download_url -match '.*/PHP.*Windows-x64.*\\.zip$' })[0].browser_download_url -OutFile 'PHP.zip'; if ($?) { Write-Output \\\"PHP Binary release version $PHPVersion downloaded\\\"; } }\"",
"SkipOnFailure": false
},
{
"UpdateStageName": "PHP Binary Extract",
"UpdateSourcePlatform": "Windows",
"UpdateSource": "ExtractArchive",
"UpdateSourceData": "PHP.zip",
"UpdateSourceTarget": "{{$FullBaseDir}}",
"OverwriteExistingFiles": true,
"DeleteAfterExtract": true,
"SkipOnFailure": false
},
{
"UpdateStageName": "PocketMine-MP Installation",
"UpdateSourcePlatform": "Windows",
"UpdateSource": "GithubRelease",
"UpdateSourceArgs": "pmmp/PocketMine-MP",
"UpdateSourceVersion": "{{PMMPVersion}}",
"UpdateSourceData": "PocketMine-MP.phar",
"UpdateSourceTarget": "{{$FullBaseDir}}",
"OverwriteExistingFiles": true
},
{
"UpdateStageName": "PocketMine-MP Installation",
"UpdateSourcePlatform": "Linux",
"UpdateSource": "Executable",
"UpdateSourceData": "/bin/bash",
"UpdateSourceArgs": "-c \"cd pocketmine-mp && PMMPVersion=\\\"{{PMMPVersion}}\\\" && if [[ -z \\\"$PMMPVersion\\\" ]]; then wget -q -O - https://get.pmmp.io | bash -s - ; elif [[ ! \\\"$PMMPVersion\\\" =~ ^([0-9]+(?:\\.[0-9]+)?(?:-(alpha|beta))?|alpha|beta|stable)$ ]]; then echo \\\"Invalid PocketMine-MP version format specified\\\" && exit 1; else wget -q -O - https://get.pmmp.io | bash -s - -v $PMMPVersion; fi\"",
"SkipOnFailure": false,
"OneShot": true
}
]