sauce.js 365 B

123456789101112131415
  1. const _ = require('lodash');
  2. const os = require('os');
  3. if (process.env.TRAVIS) {
  4. module.exports = {
  5. build: process.env.TRAVIS_BUILD_ID,
  6. tunnel: process.env.TRAVIS_JOB_NUMBER,
  7. };
  8. } else {
  9. const id = _.random(16 * 16 * 16 * 16).toString(16);
  10. module.exports = {
  11. build: `${os.hostname()}-${id}`,
  12. tunnel: `${os.hostname()}-tunnel-${id}`,
  13. };
  14. }