Esempio n. 1
0
        public static async Task <DevOpsArtifact> GetBuildArtifact(DevOpsArtifactContext artifactContext, ILogger logger)
        {
            Uri url = new Uri(Endpoints.GetArtifactsUrl(artifactContext.Organization, artifactContext.Project,
                                                        artifactContext.BuildId, artifactContext.ArtifactName));
            var response = await DevOpsClient.HttpInvoke("GET", url, logger : logger);

            return(JsonConvert.DeserializeObject <DevOpsArtifact>(await response.Content.ReadAsStringAsync()));
        }
Esempio n. 2
0
 public static DevOpsArtifact GetBuildArtifact([ActivityTrigger] DevOpsArtifactContext artifactContext, ILogger log)
 {
     log.LogInformation($"Getting the build artifact info for {artifactContext.Agent}...");
     try
     {
         DevOpsArtifact artifact = DevOpsHelper.GetBuildArtifact(artifactContext, log).Result;
         return(artifact);
     }
     catch (Exception)
     {
         // TODO: create a failed test series artifact and return it
         return(null);
     }
 }