Skip to content

Commit

Permalink
Enable appveyor RDP with env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
h3llrais3r committed May 24, 2020
1 parent 0918d85 commit d4069af
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .appveyor.yml
Expand Up @@ -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:
Expand All @@ -74,7 +78,7 @@ install:
# Install npm dependencies
- npm install

# Build command(s)
# Test command(s)
before_test:
- npm run eslint
- npm run stylelint
Expand All @@ -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'))
# 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'))
}

0 comments on commit d4069af

Please sign in to comment.