.drone.jsonnet 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. local pipeline(version) = {
  2. kind: "pipeline",
  3. name: "node-v" + version,
  4. steps: [
  5. {
  6. name: "tests",
  7. image: "node:" + version,
  8. commands: [
  9. "node -v",
  10. "npm -v",
  11. "uname -r",
  12. "npm install",
  13. "export PATH=$PATH:./node_modules/.bin/",
  14. "mocha test/units/InteractorClient.mocha.js",
  15. "mocha test/units/InteractorDaemon.mocha.js",
  16. "mocha test/units/PM2Client.mocha.js",
  17. "mocha test/units/Utility/stacktrace.mocha.js",
  18. "mocha test/units/Utility/cache.mocha.js",
  19. "mocha test/units/WatchDog.mocha.js",
  20. "mocha test/units/push/PushInteractor.mocha.js",
  21. "mocha test/units/push/TransactionAggregator.mocha.js",
  22. "mocha test/units/reverse/ReverseInteractor.mocha.js",
  23. "mocha test/units/transporters/WebsocketTransport.mocha.js",
  24. "mocha test/units/TransporterInterface.mocha.js",
  25. "mocha test/units/PM2Interface.mocha.js",
  26. "mocha test/integrations/websocket.mocha.js"
  27. ],
  28. environment: {
  29. NODE_ENV: "test",
  30. CC_TEST_REPORTER_ID: {
  31. from_secret: "code_climate_token"
  32. },
  33. PM2_HOME: "/tmp"
  34. },
  35. },
  36. ],
  37. trigger: {
  38. event: "push"
  39. },
  40. };
  41. [
  42. pipeline("8"),
  43. pipeline("10"),
  44. pipeline("12"),
  45. pipeline("13"),
  46. pipeline("14"),
  47. {
  48. kind: "pipeline",
  49. name: "publish",
  50. trigger: {
  51. event: "tag"
  52. },
  53. steps: [
  54. {
  55. name: "publish",
  56. image: "plugins/npm",
  57. settings: {
  58. username: {
  59. from_secret: "npm_username"
  60. },
  61. password: {
  62. from_secret: "npm_password"
  63. },
  64. email: {
  65. from_secret: "npm_email"
  66. },
  67. },
  68. },
  69. ],
  70. },
  71. {
  72. kind: "secret",
  73. name: "npm_username",
  74. get: {
  75. path: "secret/drone/npm",
  76. name: "username",
  77. },
  78. },
  79. {
  80. kind: "secret",
  81. name: "npm_email",
  82. get: {
  83. path: "secret/drone/npm",
  84. name: "email",
  85. },
  86. },
  87. {
  88. kind: "secret",
  89. name: "npm_password",
  90. get: {
  91. path: "secret/drone/npm",
  92. name: "password",
  93. },
  94. },
  95. {
  96. kind: "secret",
  97. name: "code_climate_token",
  98. get: {
  99. path: "secret/drone/codeclimate",
  100. name: "token_agent",
  101. },
  102. },
  103. ]