diff options
| author | cainus <[email protected]> | 2013-06-22 15:44:05 -0700 |
|---|---|---|
| committer | cainus <[email protected]> | 2013-06-22 15:44:05 -0700 |
| commit | ba65a7dd5e05e9ad97d36f2f893e8a8642aed517 (patch) | |
| tree | 31aeb7510d625fc0b09e4dce038cae5730446c0c /lib | |
| parent | 311cdeedb62363ec047f0cfe8f1d9460a9735c3a (diff) | |
| download | node-coveralls-ba65a7dd5e05e9ad97d36f2f893e8a8642aed517.tar.xz node-coveralls-ba65a7dd5e05e9ad97d36f2f893e8a8642aed517.zip | |
better jenkins support. better git object population.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/getOptions.js | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/lib/getOptions.js b/lib/getOptions.js index 46957e5..d082d70 100644 --- a/lib/getOptions.js +++ b/lib/getOptions.js @@ -17,20 +17,48 @@ var getOptions = function(){ } } - if (process.env.COVERALLS_GIT){ - options.git = process.env.COVERALLS_GIT; + + var git_commit = process.env.COVERALLS_GIT_COMMIT; + var git_branch = process.env.COVERALLS_GIT_BRANCH; + + if (process.env.TRAVIS){ + options.service_name = 'travis-ci'; + options.service_job_id = process.env.TRAVIS_JOB_ID; } - if (process.env.COVERALLS_SERVICE_JOB_ID){ - options.service_job_id = process.env.COVERALLS_SERVICE_JOB_ID; + + if (process.env.JENKINS_URL){ + options.service_name = 'jenkins'; + options.service_job_id = process.env.BUILD_ID; + git_commit = process.env.GIT_COMMIT; + git_branch = process.env.GIT_BRANCH; + } + + if (git_commit){ + options.git = { + "head": { + "id": git_commit, + "author_name": "Unknown Author", + "author_email": "", + "committer_name": "Unknown Committer", + "committer_email": "", + "message": "Unknown Commit Message" + }, + "branch": git_branch /*, + "remotes": [ + { + "name": "origin", + "url": "[email protected]:lemurheavy/coveralls-ruby.git" + } + ]*/ + }; } options.run_at = process.env.COVERALLS_RUN_AT || JSON.stringify(new Date()).slice(1, -1); if (process.env.COVERALLS_SERVICE_NAME){ options.service_name = process.env.COVERALLS_SERVICE_NAME; } - if (process.env.TRAVIS){ - options.service_name = 'travis-ci'; - options.service_job_id = process.env.TRAVIS_JOB_ID; + if (process.env.COVERALLS_SERVICE_JOB_ID){ + options.service_job_id = process.env.COVERALLS_SERVICE_JOB_ID; } // try to get the repo token as an environment variable |
