Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 83b0c80

Browse files
committed
cleanup
1 parent 49711c3 commit 83b0c80

2 files changed

Lines changed: 26 additions & 36 deletions

File tree

.travis/coveralls_uploader.js

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,31 @@
11
var fs = require('fs');
22
var request = require('request');
3-
const md5File = require('md5-file')
3+
const md5File = require('md5-file');
44

5-
//var repo_token = process.env.COVERALLS_REPO_TOKEN;
6-
//process.stdout.write("token" + process.env.COVERALLS_REPO_TOKEN);
5+
var url
6+
if (process.env.COVERALLS_URL_BASE) {
7+
url = process.env.COVERALLS_URL_BASE+'/api/v1/jobs';
8+
} else {
9+
url = 'https://coveralls.io/api/v1/jobs';
10+
}
711

8-
//if (process.env.COVERALLS_REPO_TOKEN) {
9-
10-
11-
fs.readFile('../tests/coverage.json',function (err,data) {
12-
if (err) {
13-
return console.log(err);
14-
}
15-
req = JSON.parse(data);
16-
req.service_job_id = process.env.TRAVIS_JOB_ID;
17-
req.service_name = 'travis-ci';
12+
fs.readFile('../tests/coverage.json',function (err,data) {
13+
if (err) {
14+
return console.log(err);
15+
}
16+
req = JSON.parse(data);
17+
req.service_job_id = process.env.TRAVIS_JOB_ID;
18+
req.service_name = 'travis-ci';
19+
if (process.env.COVERALLS_REPO_TOKEN) {
1820
req.repo_token = process.env.COVERALLS_REPO_TOKEN;
19-
20-
for (var i in req.source_files) {
21-
req.source_files[i].source_digest = md5File.sync("../" + req.source_files[i].name)
22-
}
23-
24-
var url = 'https://coveralls.io/api/v1/jobs';
21+
}
22+
23+
for (var i in req.source_files) {
24+
req.source_files[i].source_digest = md5File.sync("../" + req.source_files[i].name);
25+
}
2526

26-
var requestStr = JSON.stringify(req);
27-
//process.stdout.write(requestStr);
28-
29-
request.post({url : url, form : { json:requestStr}}, function(err, response, body){process.stdout.write(body);});
30-
31-
/*request.post({url : 'https://coveralls.io/api/v1/jobs', form : { json : '{"service_job_id":"207262924","service_name":"travis-ci"}'}}, function(err, response, body){
32-
33-
process.stdout.write(err);
34-
process.stdout.write(response);
35-
process.stdout.write(body);
36-
});*/
37-
27+
var requestStr = JSON.stringify(req);
28+
29+
request.post({url : url, form : { json:requestStr}}, function(err, response, body){process.stdout.write(body);});
3830

39-
});
40-
//}
41-
//else {
42-
// throw "COVERALLS_REPO_TOKEN variable is not defined";
43-
//}
31+
});

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
[![build](https://img.shields.io/travis/utPLSQL/utPLSQL/develop.svg?label=develop%20branch)](https://travis-ci.org/utPLSQL/utPLSQL)
55
[![sonar](https://sonarqube.com/api/badges/measure?key=utPLSQL%3AutPLSQL&metric=complexity)](https://sonarqube.com/dashboard/index?id=utPLSQL%3AutPLSQL)
66
[![sonar](https://sonarqube.com/api/badges/measure?key=utPLSQL%3AutPLSQL&metric=ncloc)](https://sonarqube.com/dashboard/index?id=utPLSQL%3AutPLSQL)
7+
[![Coverage Status](https://coveralls.io/repos/github/utPLSQL/utPLSQL/badge.svg?branch=master)](https://coveralls.io/github/utPLSQL/utPLSQL?branch=master)
8+
[![Coverage Status](https://coveralls.io/repos/github/utPLSQL/utPLSQL/badge.svg?branch=develop)](https://coveralls.io/github/utPLSQL/utPLSQL?branch=develop)
79

810
[![license](http://img.shields.io/badge/license-apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
911
[![chat](http://img.shields.io/badge/chat-slack-blue.svg)](http://utplsql-slack-invite.herokuapp.com/)

0 commit comments

Comments
 (0)