You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.drone.yml 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. ---
  2. #################
  3. # Frontend Test #
  4. #################
  5. kind: pipeline
  6. type: docker
  7. name: frontend_run_tests
  8. steps:
  9. - name: test-frontend
  10. image: node
  11. volumes:
  12. - name: frontend_node_cache
  13. path: /drone/src/frontend/node_modules
  14. commands:
  15. - pwd
  16. - cd ./frontend
  17. - npm install
  18. - npm test
  19. volumes:
  20. - name: frontend_node_cache
  21. host:
  22. path: /tmp/cache/drone/frontend/node_modules
  23. ---
  24. #################
  25. # Backend Tests #
  26. #################
  27. kind: pipeline
  28. type: docker
  29. name: backend_run_tests
  30. steps:
  31. - name: test-backend
  32. image: node
  33. volumes:
  34. - name: backend_node_cache
  35. path: /drone/src/backend/node_modules
  36. commands:
  37. - pwd
  38. - cd ./backend
  39. - npm install
  40. - npm test
  41. volumes:
  42. - name: backend_node_cache
  43. host:
  44. path: /tmp/cache/drone/backend/node_modules
  45. ---
  46. ##################
  47. # Frontend Build #
  48. ##################
  49. kind: pipeline
  50. type: docker
  51. name: frontend_run_build
  52. depends_on:
  53. - frontend_run_tests
  54. - backend_run_tests
  55. trigger:
  56. status:
  57. - success
  58. branch:
  59. - dev
  60. steps:
  61. - name: build-frontend
  62. image: node
  63. volumes:
  64. - name: frontend_node_cache
  65. path: /drone/src/frontend/node_modules
  66. - name: frontend_build
  67. path: /drone/src/frontend/build
  68. commands:
  69. - cd ./frontend
  70. - rm -Rf ./build/*
  71. - npx browserslist@latest --update-db
  72. - npm run build
  73. - ls ./build
  74. environment:
  75. NODE_OPTIONS: --openssl-legacy-provider
  76. volumes:
  77. - name: frontend_node_cache
  78. host:
  79. path: /tmp/cache/drone/frontend/node_modules
  80. - name: frontend_build
  81. host:
  82. path: /tmp/cache/drone/frontend/build
  83. ---
  84. #####################
  85. # Deploy to Staging #
  86. #####################
  87. kind: pipeline
  88. name: deploy
  89. depends_on:
  90. - backend_run_tests
  91. trigger:
  92. status:
  93. - success
  94. branch:
  95. - dev
  96. steps:
  97. # post-receive hook
  98. - name: push commit
  99. image: appleboy/drone-git-push:0.2.0-linux-amd64
  100. settings:
  101. branch: dev
  102. remote: maeda@165.232.128.85:/opt/staging/siimee.git
  103. remote_name: staging
  104. force: true
  105. ssh_key:
  106. # !: id_rsa from DRONE machine
  107. from_secret: push_deploy_key