Last active
January 12, 2016 19:07
-
-
Save Dalmirog-zz/fb22b8350a6acfb8f9e1 to your computer and use it in GitHub Desktop.
Script for alan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetScriptDirectory | |
{ | |
Split-Path $script:MyInvocation.MyCommand.Path | |
} | |
function GetResultsPath | |
{ | |
$parent = join-path -path $(GetScriptDirectory) -childpath $OctopusReleaseNumber | |
return Join-Path -Path $parent -ChildPath "TestResult.html" | |
} | |
function Main | |
{ | |
$exitCode = 0 | |
Try | |
{ | |
Push-Location $(GetScriptDirectory) | |
& .\RunTests.ps1 -OutputPath "$OctopusReleaseNumber" | |
$exitCode = $LastExitCode | |
#Dalmiro's line | |
$filePath = GetResultsPath | |
If(Test-Path $filePath){ | |
"File exists: $filePath" | |
} | |
else{ | |
"File not found: $filePath" | |
} | |
#end | |
New-OctopusArtifact -Path $(GetResultsPath) | |
Write-Host "Published to " $(GetResultsPath) | |
} | |
Catch | |
{ | |
$exitCode = 1 | |
Write-Host "Exception: $($_.Exception.Message)" | |
} | |
Finally | |
{ | |
Pop-Location | |
} | |
exit 0 | |
} | |
Main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment