wrap all asm deployment in check for CI. Slight formatting changes

This commit is contained in:
Daniel Donenfeld 2019-02-28 14:59:52 -08:00
parent 236efc5751
commit 792a38b841
2 changed files with 13 additions and 7 deletions

View File

@ -1,6 +1,6 @@
branches: branches:
except: except:
- /asm.*/ - /asm\/.*/
skip_branch_with_pr: true skip_branch_with_pr: true
@ -17,7 +17,7 @@ image:
- Visual Studio 2017 - Visual Studio 2017
environment: environment:
access_token: GITHUB_ACCESS_TOKEN:
secure: JoKQ6wDekwtEk9su/zJWT12TtHMsHAacSLnPe47/SV22BAfVSMMR8VCyDF/W9bE2 secure: JoKQ6wDekwtEk9su/zJWT12TtHMsHAacSLnPe47/SV22BAfVSMMR8VCyDF/W9bE2
APPVEYOR_API_TOKEN: APPVEYOR_API_TOKEN:
secure: JwBE1w4itlwjHKNDVnG+frRTexCT0x6e3iF6Qsw2Ov4= secure: JwBE1w4itlwjHKNDVnG+frRTexCT0x6e3iF6Qsw2Ov4=
@ -139,7 +139,7 @@ before_deploy:
if(-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) { if(-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) {
# Only push asm during CI. Credentials are not available during a PR # Only push asm during CI. Credentials are not available during a PR
git config --global credential.helper store | Out-Null git config --global credential.helper store | Out-Null
Add-Content "$HOME\.git-credentials" "https://$($env:access_token):x-oauth-basic@github.com`n" | Out-Null Add-Content "$HOME\.git-credentials" "https://$($env:GITHUB_ACCESS_TOKEN):x-oauth-basic@github.com`n" | Out-Null
git config --global user.email "dadonenf@microsoft.com" | Out-Null git config --global user.email "dadonenf@microsoft.com" | Out-Null
git config --global user.name "Daniel Donenfeld" | Out-Null git config --global user.name "Daniel Donenfeld" | Out-Null
Push-Location $env:APPVEYOR_BUILD_FOLDER Push-Location $env:APPVEYOR_BUILD_FOLDER
@ -150,10 +150,16 @@ deploy_script:
- ps: | - ps: |
Push-Location $env:APPVEYOR_BUILD_FOLDER Push-Location $env:APPVEYOR_BUILD_FOLDER
. .\asm\scripts\Asm-Functions.ps1 . .\asm\scripts\Asm-Functions.ps1
Publish-Asm if(-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) {
# Only publish asm during CI
Publish-Asm
}
on_finish: on_finish:
- ps: | - ps: |
Push-Location $env:APPVEYOR_BUILD_FOLDER Push-Location $env:APPVEYOR_BUILD_FOLDER
. .\asm\scripts\Asm-Functions.ps1 . .\asm\scripts\Asm-Functions.ps1
Remove-Asm-Branches if(-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) {
# Branches are only created during CI, so they only need to be deleted then
Remove-Asm-Branches
}

View File

@ -93,8 +93,6 @@ function appveyorFinished {
throw "Test jobs were not finished in $env:TIMEOUT_MINS minutes" throw "Test jobs were not finished in $env:TIMEOUT_MINS minutes"
} }
#Build System independent functions
# Returns true if any Appveyor build is "failed" or "cancelled" # Returns true if any Appveyor build is "failed" or "cancelled"
function Get-Any-Appveyor-Failures { function Get-Any-Appveyor-Failures {
(Get-AppVeyorBuild).build.jobs | Foreach-Object ` (Get-AppVeyorBuild).build.jobs | Foreach-Object `
@ -108,6 +106,8 @@ function Get-Any-Appveyor-Failures {
return $false return $false
} }
#Build System independent functions
function Remove-Asm-Branches { function Remove-Asm-Branches {
if(-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) { if(-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) {
# Delete all branches for asm if this is the last build # Delete all branches for asm if this is the last build