Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

Commit 2d176fd

Browse files
authored
Merge pull request #56 from shaneog/buildkite
Add Buildkite environment variable for commit ID
2 parents 4e9dae1 + 42c385d commit 2d176fd

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

lib/getGitData.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
process.env.GIT_COMMIT ||
1515
process.env.CIRCLE_SHA1 ||
1616
process.env.CI_COMMIT_ID ||
17-
process.env.WERCKER_GIT_COMMIT;
17+
process.env.WERCKER_GIT_COMMIT ||
18+
process.env.BUILDKITE_COMMIT;
1819

1920
if (gitCommit) {
2021
logger.debug('Received Commit Id: ' + gitCommit);

test/getGitData.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
process.env.WERCKER_GIT_COMMIT = '5232';
4040
return expect(getGitData.getCommitId()).to.eventually.equal('5232');
4141
});
42+
it('should be able to get the commit id from the Buildkite environment variable', function () {
43+
process.env.BUILDKITE_COMMIT = '47326';
44+
return expect(getGitData.getCommitId()).to.eventually.equal('47326');
45+
});
4246
it('should be able to get the commit id from Git', function () {
4347
// If we are currently running on Travis, we should be able to use the commit id environment variable
4448
// to check the git commit id method with actual git. But we can't do this for Pull Requests because

test/helper.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
process.env.CIRCLE_SHA1 = '';
7474
process.env.CI_COMMIT_ID = '';
7575
process.env.WERCKER_GIT_COMMIT = '';
76+
process.env.BUILDKITE_COMMIT = '';
7677
}
7778
};
7879
}(require('nock'), require('chai'), require('bluebird')));

0 commit comments

Comments
 (0)