-
-
Save OldCrowEW/50ebfd2b27e42514c9140ae3fd0d3caf to your computer and use it in GitHub Desktop.
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
def startPlan() { | |
def payload = buildPayload() | |
def response = httpRequest( | |
customHeaders: [ | |
[ name: "Authorization", value: "Bearer " + env.BEARER_TOKEN ], | |
[ name: "Content-Type", value: "application/vnd.api+json" ] | |
], | |
httpMode: 'POST', | |
requestBody: "${payload}", | |
url: "https://app.terraform.io/api/v2/runs" | |
) | |
def data = new JsonSlurper().parseText(response.content) | |
println ("Run Id: " + data.data.id) | |
return data.data.id | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment