From 52df9d2b998b83fe2677718e8c85dca24e8e655e Mon Sep 17 00:00:00 2001 From: Ryan Conrad Date: Mon, 28 Sep 2015 20:02:57 -0500 Subject: [PATCH] what do you know... typo. --- .appveyor/appveyor.after-deployment.ps1 | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.appveyor/appveyor.after-deployment.ps1 b/.appveyor/appveyor.after-deployment.ps1 index 1d829b3..d5521a4 100644 --- a/.appveyor/appveyor.after-deployment.ps1 +++ b/.appveyor/appveyor.after-deployment.ps1 @@ -40,7 +40,7 @@ function Publish-Release { if( $env:CI_DEPLOY_CODEPLEX -eq $true ) { Invoke-MsBuild -Path "$env:APPVEYOR_BUILD_FOLDER\.appveyor\DeployCodePlex.msbuild" -MsBuildParameters "/verbosity:detailed /p:CI_BUILD_VERSION=$env:CI_BUILD_VERSION /p:CI_BUILD_REVISION=$env:CI_BUILD_REVISION /p:CI_BUILD_MAJOR=$env:CI_BUILD_MAJOR /p:CI_BUILD_MINOR=$env:CI_BUILD_MINOR" } else { - Write-Host -BackgroundColor Yellow -ForegroundColor White "Skip `"GitHub`" deployment as environment variable has not matched (`"CI_DEPLOY_CODEPLEX`" is `"$false`", should be `"$true`")"; + Write-Host -BackgroundColor Yellow -ForegroundColor Black "Skip `"CodePlex`" deployment as environment variable has not matched (`"CI_DEPLOY_CODEPLEX`" is `"$false`", should be `"$true`")"; } # publish release @@ -53,7 +53,7 @@ if( $env:CI_DEPLOY_WEBAPI_RELEASE -eq $true -and $env:Platform -eq "x86" ) { } @($env:DevelopmentApiDomain,$env:ProductionApiDomain) | foreach { $hostname = $_; - Write-Host "Publishing Release Information '$env:CP_RELEASE_NAME' to $hostname"; + Write-Host "[WebApiRelease] Publishing Release Information '$env:CP_RELEASE_NAME' to $hostname"; $resp = Publish-Release -HostName $hostname; if($resp.StatusCode -ne 200) { Write-Host -BackgroundColor Red -ForegroundColor White $resp.StatusDescription; @@ -63,23 +63,25 @@ if( $env:CI_DEPLOY_WEBAPI_RELEASE -eq $true -and $env:Platform -eq "x86" ) { } } else { - Write-Host -BackgroundColor Yellow -ForegroundColor Black "Skip `"CodePlex`" deployment as environment variable has not matched (`"CI_DEPLOY_CODEPLEX`" is `"$false`", should be `"$true`")"; + Write-Host -BackgroundColor Yellow -ForegroundColor Black "Skip `"WebApiRelease`" deployment as environment variable has not matched (`"CI_DEPLOY_CODEPLEX`" is `"$false`", should be `"$true`")"; } if($env:PUSHBULLET_API_TOKEN) { - $timestamp = (Get-Date).ToUniversalTime().ToString("MM/dd/yyyy hh:mm:ss"); - # this allows for multiple tokens, just separate with a comma. - $env:PUSHPULLET_API_TOKEN.split(",") | foreach { + $env:PUSHBULLET_API_TOKEN.Split(",") | foreach { $pbtoken = $_; - # Send a pushbullet message if there is an api token available - Send-PushbulletMessage -apiKey $pbtoken -Type Message -Title "[Build] Droid Explorer $env:Platform v$env:CI_BUILD_VERSION Build Finished" -msg ("Build completed at $timestamp UTC"); + try { + # Send a pushbullet message if there is an api token available + Send-PushbulletMessage -apiKey $pbtoken -Type Message -Title "[Build] Droid Explorer $env:Platform v$env:CI_BUILD_VERSION Build Finished" -msg ("Build completed at $timestamp UTC"); - if( $env:Platform -eq "x64" -and $env:CI_DEPLOY_PUSHBULLET -eq $true) { - Send-PushbulletMessage -apiKey $pbtoken -Type Message -Title "[Deploy] Droid Explorer v$env:CI_BUILD_VERSION Deployed" -msg ("Deployment completed at $timestamp UTC"); - } else { - Write-Host -BackgroundColor Yellow -ForegroundColor Black "Skip `"PushBullet`" deployment as environment variable has not matched (`"CI_DEPLOY_PUSHBULLET`" is `"$false`", should be `"$true`" and `"Platform`" is `"$env:Platform`", should be `"x64`")"; + if( $env:Platform -eq "x64" -and $env:CI_DEPLOY_PUSHBULLET -eq $true) { + Send-PushbulletMessage -apiKey $pbtoken -Type Message -Title "[Deploy] Droid Explorer v$env:CI_BUILD_VERSION Deployed" -msg ("Deployment completed at $timestamp UTC"); + } else { + Write-Host -BackgroundColor Yellow -ForegroundColor Black "Skip `"PushBullet`" deployment as environment variable has not matched (`"CI_DEPLOY_PUSHBULLET`" is `"$false`", should be `"$true`" and `"Platform`" is `"$env:Platform`", should be `"x64`")"; + } + } catch [Exeption] { + Write-Error ($_ -replace $pbtoken, "[`$env:PUSHBULLET_API_TOKEN]"); } } }