Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ci_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ module.exports = {
branch: env.BUILDKITE_BRANCH,
commit_sha: env.BUILDKITE_COMMIT
};
} else if (env.GITLAB_CI) {
return {
name: "gitlab-ci",
build_identifier: env.CI_BUILD_ID,
branch: env.CI_BUILD_REF_NAME,
commit_sha: env.CI_BUILD_REF
};
} else {
return {};
}
Expand Down
7 changes: 7 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ describe('ci_info', function() {

beforeEach(function(){
delete process.env['TRAVIS'];
delete process.env['CIRCLECI'];
});

afterEach(function(){
Expand Down Expand Up @@ -79,5 +80,11 @@ describe('ci_info', function() {
assert.equal(ci.name, 'buildkite');
});

it('should return gitlab-ci as name if process.env.GITLAB_CI is set', function() {
process.env.GITLAB_CI = 'true';

var ci = CiInfo.getInfo();
assert.equal(ci.name, 'gitlab-ci');
});
});
});