public static TravisCiBuildDefinition FromJson(string json)
        {
            var slug = TravisCiService.GetJsonValue(json, "slug");
            var id   = TravisCiService.GetJsonValue(json, "id");

            return(new TravisCiBuildDefinition(slug + "/" + id));
        }
Exemplo n.º 2
0
 public TravisCiBuildStatus(TravisCiBuildDefinition travisCiBuildDefinition, string jsonDoc, BuildDefinitionSetting buildDefinitionSetting)
 {
     try
     {
         BuildStatusEnum   = ToBuildStatusEnum(TravisCiService.GetJsonValue(jsonDoc, "result"));
         BuildDefinitionId = buildDefinitionSetting.Id;
         Name         = buildDefinitionSetting.Name;
         RequestedBy  = TravisCiService.GetJsonValue(jsonDoc, "author_name");
         StartedTime  = TravisCiService.GetJsonDate(jsonDoc, "started_at");
         Comment      = TravisCiService.GetJsonValue(jsonDoc, "message");
         FinishedTime = TravisCiService.GetJsonDate(jsonDoc, "finished_at");
         Url          = "http://travis-ci.org/" + travisCiBuildDefinition.OwnerName + "/" + travisCiBuildDefinition.ProjectName + "/builds/" + TravisCiService.GetJsonValue(jsonDoc, "id");
         BuildId      = TravisCiService.GetJsonValue(jsonDoc, "id");
     }
     catch (Exception)
     {
         _log.Error("Error parsing the following json: " + jsonDoc);
         throw;
     }
 }