diff --git a/scripts/publish-to-server.ps1 b/scripts/publish-to-server.ps1 index 6866ace..cc5692f 100644 --- a/scripts/publish-to-server.ps1 +++ b/scripts/publish-to-server.ps1 @@ -7,6 +7,7 @@ param( [switch]$SkipDeploy, [switch]$SkipBackup, [switch]$AllowDirty, + [switch]$IncludeDownloadArtifacts, [switch]$DryRun ) @@ -26,7 +27,6 @@ $expectedRemoteArchive = "/tmp/equipment-management-release.tar.gz" $releasePaths = @( "backend", "frontend", - "downloads", "scripts/backup-equipment.sh", ".env.example", "AGENTS.md", @@ -37,6 +37,10 @@ $releasePaths = @( "docker-compose.yml" ) +if ($IncludeDownloadArtifacts) { + $releasePaths += "downloads" +} + function Get-CommandPath([string]$name) { $cmd = Get-Command $name -ErrorAction SilentlyContinue if (-not $cmd) { @@ -175,7 +179,11 @@ if ($files.Count -eq 0) { throw "No files matched the release allowlist." } -$artifactFiles = @(Get-DownloadArtifactFiles $projectRoot) +$artifactFiles = if ($IncludeDownloadArtifacts) { + @(Get-DownloadArtifactFiles $projectRoot) +} else { + @() +} $files = @(($files + $artifactFiles) | Sort-Object -Unique) $missingFiles = @($files | Where-Object { -not (Test-Path -LiteralPath $_ -PathType Leaf) }) @@ -197,6 +205,7 @@ Write-Host " Git commit: $commitId" Write-Host " File count: $($files.Count)" Write-Host " Source size: $([math]::Round($totalBytes / 1MB, 2)) MiB" Write-Host " Download artifacts: $($artifactFiles.Count)" +Write-Host " Include download artifacts: $([bool]$IncludeDownloadArtifacts)" Write-Host " Allowlist: $($releasePaths -join ', ')" if ($DryRun) {