.drone.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. kind: pipeline
  2. type: docker
  3. name: dev
  4. node:
  5. mode: local_test
  6. steps:
  7. # - name: yarn-install
  8. # image: gplane/pnpm:node20
  9. # volumes:
  10. # - name: modules-cache
  11. # path: /drone/src/node_modules # 下载依赖的目录挂载出来,防止重复下载
  12. # commands:
  13. # # - yarn build
  14. # # - pnpm config set registry https://registry.npmmirror.com/
  15. # # - pnpm install
  16. # # - pnpm run build
  17. # - pnpm serve
  18. - name: build
  19. image: docker:20.10.7
  20. # depends_on: [yarn-install]
  21. volumes:
  22. - name: docker
  23. path: /var/run/docker.sock
  24. - name: modules-cache
  25. path: /drone/src/node_modules # 下载依赖的目录挂载出来,防止重复下载
  26. environment:
  27. IMAGE: registry.yingcaibx.com/tl/admin_web:latest
  28. commands:
  29. # 清理 docker 服务中不再使用的镜像、挂载、网络等资源
  30. - docker system prune --force --volumes || true
  31. - docker build -f ./Dockerfile-Dev -t $IMAGE ./
  32. - name: run
  33. image: docker/compose:1.29.2
  34. depends_on: [build]
  35. volumes:
  36. - name: docker
  37. path: /var/run/docker.sock
  38. commands:
  39. - docker-compose -f docker-compose-dev.yml up -d
  40. trigger:
  41. branch:
  42. - dev
  43. event:
  44. - push
  45. volumes:
  46. - name: docker
  47. host:
  48. path: /var/run/docker.sock
  49. - name: modules-cache
  50. host:
  51. path: /data/cache/tl/new1_web
  52. ---
  53. kind: pipeline
  54. type: docker
  55. name: pre
  56. node:
  57. mode: local_pre
  58. steps:
  59. # - name: yarn-install
  60. # image: gplane/pnpm:node20
  61. # volumes:
  62. # - name: modules-cache
  63. # path: /drone/src/node_modules # 下载依赖的目录挂载出来,防止重复下载
  64. # commands:
  65. # - pnpm config set registry https://registry.npmmirror.com/
  66. # - pnpm install
  67. # - pnpm run build
  68. - name: build
  69. image: docker:20.10.7
  70. # depends_on: [yarn-install]
  71. volumes:
  72. - name: docker
  73. path: /var/run/docker.sock
  74. - name: modules-cache
  75. path: /drone/src/node_modules # 下载依赖的目录挂载出来,防止重复下载
  76. environment:
  77. IMAGE: registry.yingcaibx.com/tl/admin_web:latest
  78. commands:
  79. # 清理 docker 服务中不再使用的镜像、挂载、网络等资源
  80. - docker system prune --force --volumes || true
  81. - docker build -f ./Dockerfile-Pre -t $IMAGE ./
  82. - name: run
  83. image: docker/compose:1.29.2
  84. depends_on: [build]
  85. volumes:
  86. - name: docker
  87. path: /var/run/docker.sock
  88. commands:
  89. - docker-compose -f docker-compose-pre.yml up -d
  90. trigger:
  91. branch:
  92. - pre
  93. event:
  94. - push
  95. volumes:
  96. - name: docker
  97. host:
  98. path: /var/run/docker.sock
  99. - name: modules-cache
  100. host:
  101. path: /data/cache/tl/web_new