Add extra checks and logging

This commit is contained in:
Daniel Donenfeld 2019-02-15 11:36:40 -08:00
parent c9219945fa
commit 3d45a84f47
2 changed files with 22 additions and 2 deletions

View File

@ -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)
}
}
}

View File

@ -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"