Last active
September 3, 2020 12:21
-
-
Save stephanmg/d5b97401f079aa58239f8f5d828efe52 to your computer and use it in GitHub Desktop.
trigger_dependent_appveyor_build.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[Parameter(Mandatory=$true)][String]$APPVEYOR_TOKEN="", | |
[Parameter(Mandatory=$true)][String]$PROJECT_SLUG="", | |
[String]$APPVEYOR_USER=stephanmg) | |
if ([string]::IsNullOrWhiteSpace($APPVEYOR_TOKEN)) { "No AppVeyor API token given" } | |
if ([string]::IsNullOrWhiteSpace($PROJECT_SLUG)) { "No project slug to trigger given" } | |
if ([string]::IsNullOrWhiteSpace($APPVEYOR_USER)) { "No Appveyor user given } | |
$headers = @{Authorization = "Bearer $APPVEYOR_TOKEN" } | |
$body = @{accountName = "$APPVEYOR_USER"; projectSlug = "$PROJECT_SLUG" } | |
Invoke-RestMethod -Uri 'https://ci.appveyor.com/api/builds' -Headers $headers -Method Post -Body $body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment