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 2.6KB

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