diff --git a/travisreport.js b/travisreport.js index 475d3e0..8b20290 100644 --- a/travisreport.js +++ b/travisreport.js @@ -1,7 +1,6 @@ $(document).ready(function(){ - var travisUrl = $("td").find(".commit-build-statuses").last().find("a").attr("href"); - if (getTravisUrl == null) { + if (travisUrl == null) { console.log("TravisReport: No build found.") return; } @@ -33,17 +32,17 @@ $(document).ready(function(){ processData: false, success: function(data) { jsonResponse = data //JSON.parse(data); - console.log(data); - + console.log(data); + var failedBuild = false; for (var i = 0; i < jsonResponse['jobs'].length; i++) { console.log(data['jobs'][i]['config']['env'] + " | " + data['jobs'][i]['state']); travisData[i] = {job: data['jobs'][i]['config']['env'], state: data['jobs'][i]['state'], job_id: data["build"]["job_ids"][i], allow_failure: data["jobs"][i].allow_failure} - + if (data['jobs'][i]['state'] != "passed") { failedBuild = true; } - + } console.log(travisData); @@ -73,7 +72,7 @@ $(document).ready(function(){ } //anything beyond this has no access to ajax response. }); - + $('.tr-link').click(function() { var href = $(this).attr("href"); if(href) { @@ -117,13 +116,13 @@ function badge(status) { function outerHTML(message) { return `