Automatically set default masterlist branches on release

This commit is contained in:
Oliver Hamlet
2016-11-04 19:17:21 +00:00
parent e08b8c56ac
commit 41c713e3dc
2 changed files with 24 additions and 0 deletions
+1
View File
@@ -110,6 +110,7 @@ deploy:
on_success:
- ps: scripts\appveyor\delete_old_artifacts.ps1
- ps: scripts\appveyor\update_masterlist_branches.ps1
on_finish:
- ps: (New-Object System.Net.WebClient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", "$($env:APPVEYOR_BUILD_FOLDER)\build\$($env:CONFIGURATION)\tests.xml")
@@ -0,0 +1,23 @@
function Get-BranchName() {
$numbers = $env:APPVEYOR_REPO_TAG_NAME.Split('.')
if ($numbers[0] -eq 0) {
$numbers = $numbers[0..($numbers.length - 2)]
} else {
$numbers = @($numbers[0])
}
return "v" + ($numbers -join '.')
}
if ($env:APPVEYOR_REPO_TAG -eq 'true') {
npm install -g lomad
$branchName = Get-BranchName
Write-Output "`nUpdating masterlists' default branch to $branchName..."
lomad -t $env:access_token -a -d $branchName
if ($lastexitcode -eq 0) {
Write-Output "Masterlists' default branches have been updated."
}
}