Created
October 4, 2016 17:34
-
-
Save IlyaFinkelshteyn/89d19593318276e2538040787bc4fce7 to your computer and use it in GitHub Desktop.
Start appveyor build with API and pass value for Environment Variable
This file contains 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([string]$myVar ) | |
$token = '<API_Token>' | |
$headers = @{ | |
"Authorization" = "Bearer $token" | |
"Content-type" = "application/json" | |
} | |
$body = @{ | |
accountName="<Your_account>" | |
projectSlug="<Your_project_slug>" | |
branch="<Your_branch>" | |
environmentVariables = @{ | |
my_var=$myVar | |
} | |
} | |
$body = $body | ConvertTo-Json | |
Invoke-RestMethod -Uri 'https://ci.appveyor.com/api/builds' -Headers $headers -Body $body -Method POST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment