Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Merge pull request #37 from thornbill/gitlab-ci
Browse files Browse the repository at this point in the history
Fix GitLab CI detection
  • Loading branch information
Steve Peak committed Mar 2, 2017
2 parents f0c8aeb + 5998040 commit f224f6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/services/gitlab.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// http://doc.gitlab.com/ci/examples/README.html#environmental-variables
// https://gitlab.com/gitlab-org/gitlab-ci-runner/blob/master/lib/build.rb#L96
// https://docs.gitlab.com/ce/ci/variables/README.html

module.exports = {

detect : function(){
return process.env.CI_SERVER_NAME == 'GitLab CI';
return !!process.env.GITLAB_CI;
},

configuration : function(){
Expand Down
2 changes: 1 addition & 1 deletion test/services/gitlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var gitlab = require("../../lib/services/gitlab");
describe("Gitlab CI Provider", function(){

it ("can detect gitlab", function(){
process.env.CI_SERVER_NAME = "GitLab CI";
process.env.GITLAB_CI = "true";
expect(gitlab.detect()).to.be(true);
});

Expand Down

0 comments on commit f224f6c

Please sign in to comment.