[Pkg-javascript-commits] [node-coveralls] 144/332: add support for drone ci
Bastien Roucariès
rouca at moszumanska.debian.org
Thu Nov 9 13:53:52 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-coveralls.
commit b6b215c613b98c4f781709e41ebe0b6a8894acb5
Author: deepak1556 <hop2deep at gmail.com>
Date: Sun Feb 16 16:01:36 2014 +0530
add support for drone ci
---
README.md | 2 +-
lib/getOptions.js | 7 +++++++
test/getOptions.js | 27 +++++++++++++++++++++++++++
3 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index fa8b91f..b022e7d 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
[Coveralls.io](https://coveralls.io/) support for node.js. Get the great coverage reporting of coveralls.io and add a cool coverage button ( like the one above ) to your README.
-Supported CI services: [travis-ci](https://travis-ci.org/), [codeship](https://www.codeship.io/), [circle-ci](https://circleci.com/), [jenkins](http://jenkins-ci.org/)
+Supported CI services: [travis-ci](https://travis-ci.org/), [codeship](https://www.codeship.io/), [circle-ci](https://circleci.com/), [jenkins](http://jenkins-ci.org/), [drone](https://drone.io/)
##Installation:
Add the latest version of `coveralls` to your package.json:
diff --git a/lib/getOptions.js b/lib/getOptions.js
index 3641ffc..68016aa 100644
--- a/lib/getOptions.js
+++ b/lib/getOptions.js
@@ -14,6 +14,13 @@ var getBaseOptions = function(cb){
options.service_job_id = process.env.TRAVIS_JOB_ID;
}
+ if (process.env.DRONE){
+ options.service_name = 'drone';
+ options.service_job_id = process.env.DRONE_BUILD_NUMBER;
+ git_commit = process.env.DRONE_COMMIT;
+ git_branch = process.env.DRONE_BRANCH;
+ }
+
if (process.env.JENKINS_URL){
options.service_name = 'jenkins';
options.service_job_id = process.env.BUILD_ID;
diff --git a/test/getOptions.js b/test/getOptions.js
index 76691a3..a0aef46 100644
--- a/test/getOptions.js
+++ b/test/getOptions.js
@@ -49,6 +49,9 @@ describe("getBaseOptions", function(){
it ("should set service_name and service_job_id if it's running on codeship", function(done){
testCodeship(getBaseOptions, done);
});
+ it ("should set service_name and service_job_id if it's running on drone", function(done){
+ testDrone(getBaseOptions, done);
+ });
});
describe("getOptions", function(){
@@ -119,6 +122,9 @@ describe("getOptions", function(){
it ("should set service_name and service_job_id if it's running on codeship", function(done){
testCodeship(getOptions, done);
});
+ it ("should set service_name and service_job_id if it's running on drone", function(done){
+ testDrone(getBaseOptions, done);
+ });
});
var testServiceJobId = function(sut, done){
@@ -303,6 +309,27 @@ var testCodeship = function(sut, done) {
});
};
+var testDrone = function(sut, done) {
+ process.env.DRONE = true;
+ process.env.DRONE_BUILD_NUMBER = '1234';
+ process.env.DRONE_COMMIT = "e3e3e3e3e3e3e3e3e";
+ process.env.DRONE_BRANCH = "master";
+ sut(function(err, options){
+ options.service_name.should.equal("drone");
+ options.service_job_id.should.equal("1234");
+ options.git.should.eql({ head:
+ { id: 'e3e3e3e3e3e3e3e3e',
+ author_name: 'Unknown Author',
+ author_email: '',
+ committer_name: 'Unknown Committer',
+ committer_email: '',
+ message: 'Unknown Commit Message' },
+ branch: 'master',
+ remotes: [] });
+ done();
+ });
+};
+
function ensureLocalGitContext(options) {
var path = require('path');
var fs = require('fs');
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-coveralls.git
More information about the Pkg-javascript-commits
mailing list