diff --git a/ci/Publish.ps1 b/ci/Publish.ps1 index 6993122a..10fefaa1 100644 --- a/ci/Publish.ps1 +++ b/ci/Publish.ps1 @@ -38,3 +38,7 @@ dotnet publish $BuildPath ` --runtime $Runtime ` --self-contained $selfContained ` $singleFileArgs + +if ($LASTEXITCODE -ne 0) { + throw "dotnet publish failed" +} diff --git a/docker/BuildAndRun.ps1 b/docker/BuildAndRun.ps1 index d96492af..6ec8ea19 100644 --- a/docker/BuildAndRun.ps1 +++ b/docker/BuildAndRun.ps1 @@ -4,6 +4,8 @@ param ( [string[]] $RunArgs ) +$ErrorActionPreference = "Stop" + $artifactsDir = "$PSScriptRoot\artifacts" # Delete old build artifacts @@ -24,6 +26,9 @@ finally { Push-Location "$PSScriptRoot\..\debugging" try { docker compose up -d --pull always + if ($LASTEXITCODE -ne 0) { + throw "docker compose up failed" + } } finally { Pop-Location @@ -31,6 +36,13 @@ finally { # Finally, build the docker image and run it docker compose build +if ($LASTEXITCODE -ne 0) { + throw "docker compose build failed" +} + # TODO: Use `--build` when it releases: # https://github.com/docker/compose/issues/10003 docker compose run --rm recyclarr @RunArgs +if ($LASTEXITCODE -ne 0) { + throw "docker compose run failed" +}