From 792a38b84194261b4f13b2f5ae30fce8a70f5ccf Mon Sep 17 00:00:00 2001 From: Daniel Donenfeld Date: Thu, 28 Feb 2019 14:59:52 -0800 Subject: [PATCH] wrap all asm deployment in check for CI. Slight formatting changes --- appveyor.yml | 16 +++++++++++----- asm/scripts/Asm-Functions.ps1 | 4 ++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 88e21c4..de0966c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ branches: except: - - /asm.*/ + - /asm\/.*/ skip_branch_with_pr: true @@ -17,7 +17,7 @@ image: - Visual Studio 2017 environment: - access_token: + GITHUB_ACCESS_TOKEN: secure: JoKQ6wDekwtEk9su/zJWT12TtHMsHAacSLnPe47/SV22BAfVSMMR8VCyDF/W9bE2 APPVEYOR_API_TOKEN: secure: JwBE1w4itlwjHKNDVnG+frRTexCT0x6e3iF6Qsw2Ov4= @@ -139,7 +139,7 @@ before_deploy: if(-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) { # Only push asm during CI. Credentials are not available during a PR 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.name "Daniel Donenfeld" | Out-Null Push-Location $env:APPVEYOR_BUILD_FOLDER @@ -150,10 +150,16 @@ deploy_script: - ps: | Push-Location $env:APPVEYOR_BUILD_FOLDER . .\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: - ps: | Push-Location $env:APPVEYOR_BUILD_FOLDER . .\asm\scripts\Asm-Functions.ps1 - Remove-Asm-Branches \ No newline at end of file + 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 + } \ No newline at end of file diff --git a/asm/scripts/Asm-Functions.ps1 b/asm/scripts/Asm-Functions.ps1 index 1858de6..6a6d51b 100644 --- a/asm/scripts/Asm-Functions.ps1 +++ b/asm/scripts/Asm-Functions.ps1 @@ -93,8 +93,6 @@ function appveyorFinished { 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" function Get-Any-Appveyor-Failures { (Get-AppVeyorBuild).build.jobs | Foreach-Object ` @@ -108,6 +106,8 @@ function Get-Any-Appveyor-Failures { return $false } +#Build System independent functions + function Remove-Asm-Branches { if(-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) { # Delete all branches for asm if this is the last build