Last active
October 9, 2017 15:00
-
-
Save IlyaFinkelshteyn/a79eb4bd6eb9c59f63e63b23e2713218 to your computer and use it in GitHub Desktop.
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
$token = '<API_Token>' | |
$headers = @{ | |
"Authorization" = "Bearer $token" | |
"Content-type" = "application/json" | |
} | |
#if you do not know build version and want to use latest: | |
#$buildVersion = (Invoke-RestMethod -Uri "https://ci.appveyor.com/api/projects/<Your_account>/<Your_project_slug>" -Headers $headers -Method GET).build.version | |
#if you need latest build version for specific branch: | |
#$buildVersion = (Invoke-RestMethod -Uri "https://ci.appveyor.com/api/projects/<Your_account>/<Your_project_slug>/branch/<branch_name>" -Headers $headers -Method GET).build.version | |
$body = @{ | |
environmentName="<Your_environment>" | |
accountName="<Your_account>" | |
projectSlug="<Your_project_slug>" | |
# $env:APPVEYOR_BUILD_VERSION can be used when calling from build job | |
# or $buildVersion if you are calling separately (see how we get it above commented) | |
buildVersion="<build_version_to_deploy>" | |
environmentVariables = @{ | |
my_var=$myVar | |
} | |
} | |
$body = $body | ConvertTo-Json | |
Invoke-RestMethod -Uri 'https://ci.appveyor.com/api/deployments' -Headers $headers -Body $body -Method POST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment