How to use the azure-devops-node-api/interfaces/BuildInterfaces.BuildResult function in azure-devops-node-api

To help you get started, we’ve selected a few azure-devops-node-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / azure-devops-node-api / samples / buildArtifact.ts View on Github external
const project = cm.getProject();
        console.log("project", project);

        // get the latest successful build.
        cm.heading(`Get latest successful build for ${project} project`);
        const builds: bi.Build[] = await vstsBuild.getBuilds(
                        project,
                        null,                       // definitions: number[]
                        null,                       // queues: number[]
                        null,                       // buildNumber
                        null, //new Date(2016, 1, 1),       // minFinishTime
                        null,                       // maxFinishTime
                        null,                       // requestedFor: string
                        bi.BuildReason.All,         // reason
                        bi.BuildStatus.Completed,
                        bi.BuildResult.Succeeded,
                        null,                       // tagFilters: string[]
                        null,                       // properties: string[]
                        //bi.DefinitionType.Build,
                        1                           // top: number
                        );

        if (builds.length > 0) {
            const latestBuild: bi.Build = builds[0];
            console.log(`build ${latestBuild.id}`);

            // Retrieve the list of artifacts for the latest build.
            cm.heading(`Artifacts for build ${latestBuild.id}, ${project} project`);
            const artifacts: bi.BuildArtifact[] = await vstsBuild.getArtifacts(project, latestBuild.id);

            let downloadableArtifact;
            for (const artifact of artifacts) {
github openupm / openupm / app / utils / azure.js View on Github external
// Azure util.
const Enum = require("enum");

const azureDevops = require("azure-devops-node-api");
const config = require("config");
const buildInterfaces = require("azure-devops-node-api/interfaces/BuildInterfaces");
const util = require("util");

const BuildStatus = new Enum(buildInterfaces.BuildStatus);
const BuildResult = new Enum(buildInterfaces.BuildResult);
const sleep = util.promisify(setTimeout);

const logger = require("./log")(module);

// Get build api.
const getBuildApi = async function() {
  let authHandler = azureDevops.getPersonalAccessTokenHandler(
    config.azureDevops.token
  );
  let conn = new azureDevops.WebApi(config.azureDevops.endpoint, authHandler);
  let buildApi = await conn.getBuildApi();
  return buildApi;
};

// Queue build in azure pipelines and return the build object.
const queueBuild = async function(buildApi, definitionId, parameters) {