示例#1
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);
     }
 }
        public static BlobUploadContext GetWorkerArtifactUploadContext(DevOpsArtifact artifact, string platform, string worker)
        {
            var workerPrefix  = Constants.WorkerConfigToPrefix[worker];
            var commonPrefix  = Constants.EnvVars.WorkerCommonPrefix;
            var uploadContext = new BlobUploadContext
            {
                Worker      = worker,
                Artifact    = artifact,
                Platform    = platform,
                Environment = EnvironmentHelper.GetHostEnvironment()
            };

            return(uploadContext);
        }