trigger-pro-tests.sh 952 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 = 'handsontable-pro';
  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. branch: 'develop',
  19. config: {
  20. env: {
  21. global: [
  22. `HOT_BRANCH=${process.env.TRAVIS_BRANCH}`,
  23. `HOT_FOREIGN_TRIGGER=true`,
  24. ],
  25. },
  26. },
  27. }
  28. },
  29. };
  30. request(options, (err, res) => {
  31. if (err) {
  32. process.exit(1);
  33. }
  34. if (res.statusCode >= 400) {
  35. process.exit(1);
  36. }
  37. });