From db674c797786de057023c3af595f96a83f74a720 Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Tue, 19 Apr 2016 16:00:09 -0700 Subject: [PATCH] Add try-catch to on_finish section to prevent hang --- appveyor.yml | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ed2313d31d..ab0366493b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -64,19 +64,23 @@ test_script: on_finish: - ps: | $ErrorActionPreference = 'Stop' - # Creating project artifact - $name = git describe - $zipFilePath = Join-Path $pwd "$name.zip" - $zipFileFullPath = Join-Path $pwd "$name.FullCLR.zip" - Add-Type -assemblyname System.IO.Compression.FileSystem - [System.IO.Compression.ZipFile]::CreateFromDirectory($env:CoreOutput, $zipFilePath) - [System.IO.Compression.ZipFile]::CreateFromDirectory($env:FullOutput, $zipFileFullPath) - - @( - # You can add other artifacts here - $zipFilePath, - $zipFileFullPath - ) | % { - Write-Host "Pushing package $_ as Appveyor artifact" - Push-AppveyorArtifact $_ - } + try { + # Creating project artifact + $name = git describe + $zipFilePath = Join-Path $pwd "$name.zip" + $zipFileFullPath = Join-Path $pwd "$name.FullCLR.zip" + Add-Type -assemblyname System.IO.Compression.FileSystem + [System.IO.Compression.ZipFile]::CreateFromDirectory($env:CoreOutput, $zipFilePath) + [System.IO.Compression.ZipFile]::CreateFromDirectory($env:FullOutput, $zipFileFullPath) + + @( + # You can add other artifacts here + $zipFilePath, + $zipFileFullPath + ) | % { + Write-Host "Pushing package $_ as Appveyor artifact" + Push-AppveyorArtifact $_ + } + } catch { + Write-Host -Foreground Red $_ + }