рабочий вариант, но скороть 10 МБит
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#requires -Version 5
|
||||
#requires -Version 5
|
||||
|
||||
param(
|
||||
[string]$RepoRoot = (Resolve-Path (Join-Path $PSScriptRoot "..\..")).Path,
|
||||
@@ -8,7 +8,8 @@ param(
|
||||
[switch]$PrintOnly,
|
||||
[bool]$PublishToTestDockerDownloads = $false,
|
||||
[string]$TestDockerSshAlias = "test-docker",
|
||||
[string]$TestDockerDownloadPath = "/tmp/rap-web-admin/html/downloads"
|
||||
[string]$TestDockerDownloadPath = "/tmp/rap-web-admin/html/downloads",
|
||||
[string]$TestDockerBackendReleasePath = "/tmp/rap-release-0.2.309-latencyaware"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
@@ -53,7 +54,8 @@ function Get-JavaVersion {
|
||||
Fail "Java не найден в PATH. Нужен JDK 17+."
|
||||
}
|
||||
|
||||
$versionLine = & $javaCandidate.Source -version 2>&1 | Select-Object -First 1
|
||||
$escapedJava = $javaCandidate.Source.Replace('"', '\"')
|
||||
$versionLine = & cmd.exe /c "`"$escapedJava`" -version 2>&1" | Select-Object -First 1
|
||||
if ($versionLine -match "version\s+`"(\d+)\.") {
|
||||
return $matches[1]
|
||||
}
|
||||
@@ -134,7 +136,9 @@ function Publish-Artifact {
|
||||
}
|
||||
}
|
||||
|
||||
$published | ConvertTo-Json -Depth 6 | Out-File -FilePath $metaPath -Encoding utf8 -Force
|
||||
$manifestJson = ($published | ConvertTo-Json -Depth 6) + [Environment]::NewLine
|
||||
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
||||
[System.IO.File]::WriteAllText($metaPath, $manifestJson, $utf8NoBom)
|
||||
|
||||
return @{
|
||||
latest = $latestPath
|
||||
@@ -306,6 +310,7 @@ try {
|
||||
|
||||
if ($PrintOnly) {
|
||||
Write-Host "PrintOnly: сборка не выполнена."
|
||||
$global:LASTEXITCODE = 0
|
||||
return
|
||||
}
|
||||
|
||||
@@ -384,6 +389,15 @@ try {
|
||||
-LatestFile $remotePublishSource.latest `
|
||||
-VersionFile $remotePublishSource.versioned `
|
||||
-ManifestFile $remotePublishSource.summary
|
||||
|
||||
if (-not [string]::IsNullOrWhiteSpace($TestDockerBackendReleasePath) -and $TestDockerBackendReleasePath -ne $TestDockerDownloadPath) {
|
||||
Write-Host "Публикую артефакты в backend RAP_RELEASE_DIR ($TestDockerSshAlias): $TestDockerBackendReleasePath"
|
||||
Publish-ToTestDockerDownloads -RemoteHost $TestDockerSshAlias -RemoteRoot (Resolve-RemoteDirectory $TestDockerBackendReleasePath) `
|
||||
-VersionName $versionName `
|
||||
-LatestFile $remotePublishSource.latest `
|
||||
-VersionFile $remotePublishSource.versioned `
|
||||
-ManifestFile $remotePublishSource.summary
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Сборка завершена."
|
||||
@@ -401,3 +415,5 @@ finally {
|
||||
if (-not $buildSucceeded) {
|
||||
Fail "Сборка не завершена."
|
||||
}
|
||||
|
||||
$global:LASTEXITCODE = 0
|
||||
|
||||
Reference in New Issue
Block a user