Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

.drone.yml 3.3KB

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