chiark / gitweb /
build-status: migrate to travis-ci.com.
authorVladimír Vondruš <mosra@centrum.cz>
Fri, 23 Oct 2020 14:35:00 +0000 (16:35 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Fri, 23 Oct 2020 14:35:00 +0000 (16:35 +0200)
Wait, don't tell me it's *this* easy.

doc/build-status.js

index cc080434279cfa8d9b55e62f8f1a682bfe5a3fe3..1ecc83e1e456a8888637a21eb7c8e41983a49a04 100644 (file)
@@ -6,7 +6,7 @@ var travisJobIdRe = /JOBID=([a-zA-Z0-9-]+)/
 /* Ability to override the projects via query string */
 if(location.search) {
     let params = new URLSearchParams(location.search);
-    projects = []
+    projects = [];
     for(let p of params) projects.push(p);
 }
 
@@ -29,8 +29,8 @@ function fetchTravisJobStatus(latestJobs) {
     var req = window.XDomainRequest ? new XDomainRequest() : new XMLHttpRequest();
     if(!req) return;
 
-    req.open("GET", 'https://api.travis-ci.org/jobs?ids[]=' + latestJobs.join('&ids[]='), true);
-    req.setRequestHeader("Accept", "application/vnd.travis-ci.2+json");
+    req.open("GET", 'https://api.travis-ci.com/jobs?ids[]=' + latestJobs.join('&ids[]='), true);
+    req.setRequestHeader("Accept", "application/vnd.travis-ci.2.1+json");
     req.responseType = 'json';
     req.onreadystatechange = function() {
         if(req.readyState != 4) return;
@@ -95,7 +95,7 @@ function fetchTravisJobStatus(latestJobs) {
                 title = jobs[i]['state'];
             }
 
-            elem.innerHTML = '<a href="https://travis-ci.org/' + repo + '/jobs/' + jobs[i]['id'] + '" title="' + title + '">' + status + '<br /><span class="m-text m-small">' + age + '</span></a>';
+            elem.innerHTML = '<a href="https://travis-ci.com/' + repo + '/jobs/' + jobs[i]['id'] + '" title="' + title + '">' + status + '<br /><span class="m-text m-small">' + age + '</span></a>';
             elem.className = type;
         }
     };
@@ -106,8 +106,8 @@ function fetchLatestTravisJobs(project, branch) {
     var req = window.XDomainRequest ? new XDomainRequest() : new XMLHttpRequest();
     if(!req) return;
 
-    req.open("GET", 'https://api.travis-ci.org/repos/' + project + '/branches/' + branch, true);
-    req.setRequestHeader("Accept", "application/vnd.travis-ci.2+json");
+    req.open("GET", 'https://api.travis-ci.com/repos/' + project + '/branches/' + branch, true);
+    req.setRequestHeader("Accept", "application/vnd.travis-ci.2.1+json");
     req.responseType = 'json';
     req.onreadystatechange = function() {
         if(req.readyState != 4) return;