Release: weekly deploy

This commit is contained in:
Danila Khodjaef
2026-07-09 16:03:48 +03:00
parent 0ceb1c1c8c
commit 62096e8210
16 changed files with 169 additions and 38 deletions
+1 -3
View File
@@ -564,9 +564,7 @@ if (Get-StepEnabled $steps 'syncImages') {
if (Get-StepEnabled $steps 'dockerPublish') {
$ok = Invoke-Step 'dockerPublish' {
$tag = if ($cfg.release.imageTag) { $cfg.release.imageTag } else { 'latest' }
Write-Host "Docker release tag: $tag"
$code = Invoke-Npm 'prod:docker:publish' @('-Tag', $tag)
$code = Invoke-Npm 'prod:docker:publish'
return $code
}
if (-not $ok) { Write-ReleaseBanner -Success $false -FailedAt $FailedStep; exit 1 }
+58
View File
@@ -0,0 +1,58 @@
function Get-BuildMetadata {
param([string]$RepoRoot)
$gitSha = ''
$appVersion = '0.0.0'
try {
Push-Location $RepoRoot
$gitSha = (git rev-parse --short HEAD 2>$null).Trim()
$appVersion = (node -p "require('./package.json').version" 2>$null).Trim()
} finally {
Pop-Location
}
if (-not $gitSha) { $gitSha = 'unknown' }
if (-not $appVersion) { $appVersion = '0.0.0' }
$buildTime = Get-Date
$buildTimeUtc = $buildTime.ToUniversalTime().ToString("yyyy-MM-dd'T'HH:mm:ss'Z'")
return @{
GitSha = $gitSha
AppVersion = $appVersion
BuildTimeUtc = $buildTimeUtc
ReleaseTag = New-ReleaseImageTag -GitSha $gitSha -BuildTime $buildTime
}
}
function New-ReleaseImageTag {
param(
[string]$GitSha,
[datetime]$BuildTime
)
if (-not $BuildTime) { $BuildTime = Get-Date }
if (-not $GitSha) { $GitSha = 'unknown' }
$stamp = $BuildTime.ToString('yyyyMMdd-HHmmss')
return "$stamp-$GitSha"
}
function Write-LastDockerRelease {
param(
[string]$RepoRoot,
[hashtable]$Metadata,
[string]$Image
)
$manifestPath = Join-Path $RepoRoot 'infra\deploy\last-docker-release.json'
$manifest = @{
image = $Image
release_tag = $Metadata.ReleaseTag
git_sha = $Metadata.GitSha
app_version = $Metadata.AppVersion
built_at = $Metadata.BuildTimeUtc
pushed_at = (Get-Date).ToUniversalTime().ToString("yyyy-MM-dd'T'HH:mm:ss'Z'")
}
$manifest | ConvertTo-Json -Depth 4 | Set-Content -LiteralPath $manifestPath -Encoding UTF8
return $manifestPath
}