circle.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. version: 2.0
  2. jobs:
  3. build:
  4. docker:
  5. - image: circleci/node:10
  6. steps:
  7. - checkout
  8. - restore_cache:
  9. key: send-{{ checksum "package-lock.json" }}
  10. - run: npm install
  11. - save_cache:
  12. key: send-{{ checksum "package-lock.json" }}
  13. paths:
  14. - node_modules
  15. - run: npm run build
  16. - persist_to_workspace:
  17. root: .
  18. paths:
  19. - ./dist
  20. test:
  21. docker:
  22. - image: circleci/node:10-browsers
  23. steps:
  24. - checkout
  25. - restore_cache:
  26. key: send-{{ checksum "package-lock.json" }}
  27. - run: npm install
  28. - save_cache:
  29. key: send-{{ checksum "package-lock.json" }}
  30. paths:
  31. - node_modules
  32. - run: npm run lint
  33. - run: npm run test
  34. - store_artifacts:
  35. path: coverage
  36. integration_tests:
  37. machine: true
  38. steps:
  39. - checkout
  40. - attach_workspace:
  41. at: .
  42. - run:
  43. name: Install Docker Compose
  44. command: |
  45. set -x
  46. pip install docker-compose>=1.18
  47. docker-compose --version
  48. - run:
  49. command: npm run test-integration
  50. - store_artifacts:
  51. path: coverage/send-test.html
  52. deploy_dev:
  53. machine: true
  54. steps:
  55. - checkout
  56. - attach_workspace:
  57. at: .
  58. - run: docker login -u $DOCKER_USER -p $DOCKER_PASS
  59. - run: docker build -t mozilla/send:latest .
  60. - run: docker push mozilla/send:latest
  61. deploy_stage:
  62. machine: true
  63. steps:
  64. - checkout
  65. - attach_workspace:
  66. at: .
  67. - run: docker login -u $DOCKER_USER -p $DOCKER_PASS
  68. - run: docker build -t mozilla/send:$CIRCLE_TAG .
  69. - run: docker push mozilla/send:$CIRCLE_TAG
  70. workflows:
  71. version: 2
  72. test_pr:
  73. jobs:
  74. - build:
  75. filters:
  76. branches:
  77. ignore: master
  78. - test:
  79. filters:
  80. branches:
  81. ignore: master
  82. # - integration_tests:
  83. # filters:
  84. # branches:
  85. # ignore: master
  86. # requires:
  87. # - build
  88. build_and_deploy_dev:
  89. jobs:
  90. - build:
  91. filters:
  92. branches:
  93. only: master
  94. tags:
  95. ignore: /^v.*/
  96. - deploy_dev:
  97. requires:
  98. - build
  99. filters:
  100. branches:
  101. only: master
  102. tags:
  103. ignore: /^v.*/
  104. build_and_deploy_stage:
  105. jobs:
  106. - build:
  107. filters:
  108. branches:
  109. ignore: /.*/
  110. tags:
  111. only: /^v.*/
  112. - test:
  113. filters:
  114. branches:
  115. ignore: /.*/
  116. tags:
  117. only: /^v.*/
  118. - integration_tests:
  119. requires:
  120. - build
  121. filters:
  122. branches:
  123. ignore: /.*/
  124. tags:
  125. only: /^v.*/
  126. - deploy_stage:
  127. requires:
  128. - build
  129. - test
  130. - integration_tests
  131. filters:
  132. branches:
  133. ignore: /.*/
  134. tags:
  135. only: /^v.*/