Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slamb2k/3f0c84a2d9461759f010398effeade46 to your computer and use it in GitHub Desktop.
Save slamb2k/3f0c84a2d9461759f010398effeade46 to your computer and use it in GitHub Desktop.
VSMobileCenterBuildRequest
// Construct build definition Url
var buildDefinitionUrl = `${mobileCenterBaseUrl}/branches/master/builds`;
var options = {
url: buildDefinitionUrl,
method: 'POST',
headers: {
"X-API-Token": apiToken,
"Accept": "application/json",
"Content-Type": "application/json"
}
};
request(options)
.then(function (body) {
// Parse the response so we can get the id of the new version
var buildDefinitionResponse = JSON.parse(body);
var buildId = buildDefinitionResponse.id;
return buildId;
})
.then(function (buildId) {
util.debug("Starting build for Build Id: {0}", buildId);
return waitForCompletion(buildId);
})
.then(function (buildId) {
util.debug("Build is complete. Retrieving built output...");
return downloadOutput(buildId);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment