sauce.js 453 B

1234567891011121314151617181920
  1. var _ = require('lodash');
  2. var os = require('os');
  3. var options = {
  4. username: process.env.SAUCE_USERNAME,
  5. accessKey: process.env.SAUCE_ACCESS_KEY
  6. };
  7. if (process.env.TRAVIS) {
  8. module.exports = {
  9. build: process.env.TRAVIS_BUILD_ID,
  10. tunnel: process.env.TRAVIS_JOB_NUMBER
  11. };
  12. } else {
  13. var id = _.random(16*16*16*16).toString(16);
  14. module.exports = {
  15. build: os.hostname() + '-' + id,
  16. tunnel: os.hostname() + '-tunnel-' + id
  17. };
  18. }