From 3d45a84f47ec8755b5094de088e263447f0b2824 Mon Sep 17 00:00:00 2001 From: Daniel Donenfeld Date: Fri, 15 Feb 2019 11:36:40 -0800 Subject: [PATCH] Add extra checks and logging --- appveyor.yml | 8 +++++++- asm/scripts/deploy-asm.ps1 | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index fe97517..ba8f620 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -166,7 +166,13 @@ on_finish: "Authorization" = "Bearer $env:APPVEYOR_API_TOKEN" "Content-type" = "application/json" } - $build.build.jobs | Foreach-Object { git push origin --delete asm/$($env:APPVEYOR_REPO_COMMIT)/appveyor-$($_.jobId) } + $build.build.jobs | Foreach-Object { + $branchName = "asm/$($env:APPVEYOR_REPO_COMMIT)/appveyor-$($_.jobId)" + git ls-remote --heads --exit-code https://github.com/dadonenf/GSL.git $branchName + if($?){ + git push origin --delete asm/$($env:APPVEYOR_REPO_COMMIT)/appveyor-$($_.jobId) + } + } } diff --git a/asm/scripts/deploy-asm.ps1 b/asm/scripts/deploy-asm.ps1 index 1ce238f..14a422d 100644 --- a/asm/scripts/deploy-asm.ps1 +++ b/asm/scripts/deploy-asm.ps1 @@ -110,7 +110,20 @@ function collectAsm { #collect all branches to merge $asmBranches = @() - (Get-AppVeyorBuild).build.jobs | Foreach-Object { $asmBranches += "origin/asm/$($env:APPVEYOR_REPO_COMMIT)/appveyor-$($_.jobId)"} + (Get-AppVeyorBuild).build.jobs | Foreach-Object { + $branchName = "asm/$($env:APPVEYOR_REPO_COMMIT)/appveyor-$($_.jobId)" + + #Check that all branches exist + git ls-remote --heads --exit-code https://github.com/dadonenf/GSL.git $branchName + if(-not $?){ + throw "Missing branch for job $($_.jobId)" + } + + #Add origin branch to the branch list + $branchName = "origin/"+$branchName + $asmBranches += $branchName + } + #TODO: collect asm from travis # $travisBuild = Get-TravisBuild # $travisJobs = @() @@ -121,6 +134,7 @@ function collectAsm { git checkout master git pull git branch -a + Write-Host "git merge --squash $($branchString)" git merge --squash $branchString if(-not $?){ throw "Failed merge"