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

Commit

Permalink
Merge pull request #56 from shaneog/buildkite
Browse files Browse the repository at this point in the history
Add Buildkite environment variable for commit ID
  • Loading branch information
rtfpessoa committed Mar 20, 2018
2 parents 4e9dae1 + 42c385d commit 2d176fd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/getGitData.js
Expand Up @@ -14,7 +14,8 @@
process.env.GIT_COMMIT ||
process.env.CIRCLE_SHA1 ||
process.env.CI_COMMIT_ID ||
process.env.WERCKER_GIT_COMMIT;
process.env.WERCKER_GIT_COMMIT ||
process.env.BUILDKITE_COMMIT;

if (gitCommit) {
logger.debug('Received Commit Id: ' + gitCommit);
Expand Down
4 changes: 4 additions & 0 deletions test/getGitData.js
Expand Up @@ -39,6 +39,10 @@
process.env.WERCKER_GIT_COMMIT = '5232';
return expect(getGitData.getCommitId()).to.eventually.equal('5232');
});
it('should be able to get the commit id from the Buildkite environment variable', function () {
process.env.BUILDKITE_COMMIT = '47326';
return expect(getGitData.getCommitId()).to.eventually.equal('47326');
});
it('should be able to get the commit id from Git', function () {
// If we are currently running on Travis, we should be able to use the commit id environment variable
// to check the git commit id method with actual git. But we can't do this for Pull Requests because
Expand Down
1 change: 1 addition & 0 deletions test/helper.js
Expand Up @@ -73,6 +73,7 @@
process.env.CIRCLE_SHA1 = '';
process.env.CI_COMMIT_ID = '';
process.env.WERCKER_GIT_COMMIT = '';
process.env.BUILDKITE_COMMIT = '';
}
};
}(require('nock'), require('chai'), require('bluebird')));

0 comments on commit 2d176fd

Please sign in to comment.