Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
// 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"
.then(function (body) {
// Parse the response so we can get the id of the new version
var buildDefinitionResponse = JSON.parse(body);
var buildId =;
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