From d4069af04e14b398cbe59e7367ad36fadabd38a8 Mon Sep 17 00:00:00 2001 From: h3llrais3r Date: Sun, 24 May 2020 21:29:45 +0200 Subject: [PATCH] Enable appveyor RDP with env variable --- .appveyor.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 9ba751218..9197db1fb 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -52,8 +52,12 @@ init: https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` throw "There are newer queued builds for this pull request, failing early." } - # Enable RDP - - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + # Enable RDP if environment variable is set (https://ci.appveyor.com/project/h3llrais3r/auto-subliminal/settings/environment) + - ps: | + if ($env:APPVEYOR_RDP -eq 'TRUE') { + Add-AppveyorMessage "Start remote desktop connection" + iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + } # Command(s) to install dependencies install: @@ -74,7 +78,7 @@ install: # Install npm dependencies - npm install -# Build command(s) +# Test command(s) before_test: - npm run eslint - npm run stylelint @@ -83,6 +87,10 @@ test_script: - coverage run setup.py test - coverage report -# Block RDP on failure -on_failure: - - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) \ No newline at end of file +# On finish command(s) +on_finish: + - ps: | + if ($env:APPVEYOR_RDP -eq 'TRUE') { + Add-AppveyorMessage "Stop remote desktop connection" + $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + } \ No newline at end of file