trigger-hot-builder-tests.sh 970 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/usr/bin/env node
  2. const request = require('request');
  3. const ENDPOINT = 'https://api.travis-ci.org';
  4. const REPO_OWNER = 'handsontable';
  5. const REPO_PROJECT = 'hot-builder';
  6. const options = {
  7. method: 'POST',
  8. url: `${ENDPOINT}/repo/${REPO_OWNER}%2F${REPO_PROJECT}/requests`,
  9. headers: {
  10. Authorization: `token ${process.env.TCI_TOKEN}`,
  11. Accept: 'application/json',
  12. ContentType: 'application/json',
  13. 'Travis-API-Version': '3',
  14. },
  15. json: {
  16. request: {
  17. message: `Checking triggered from handsontable/handsontable repository (the ${process.env.TRAVIS_BRANCH} branch)`,
  18. // Always check only master branch (release branch) of the hot-builder repository.
  19. branch: 'master',
  20. config: {
  21. env: {
  22. global: [`HOT_BRANCH=${process.env.TRAVIS_BRANCH}`],
  23. },
  24. },
  25. }
  26. },
  27. };
  28. request(options, (err, res) => {
  29. if (err) {
  30. process.exit(1);
  31. }
  32. if (res.statusCode >= 400) {
  33. process.exit(1);
  34. }
  35. });