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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. kind: pipeline
  2. name: default
  3. steps:
  4. - name: restore cache
  5. image: drillster/drone-volume-cache
  6. settings:
  7. restore: true
  8. mount:
  9. - ./node_modules
  10. volumes:
  11. - name: cache
  12. path: /cache
  13. - name: npm install
  14. image: node:12
  15. commands:
  16. - npm install
  17. - name: npm run build
  18. image: node:12
  19. commands:
  20. - npm run build
  21. - name: rebuild cache
  22. image: drillster/drone-volume-cache
  23. settings:
  24. rebuild: true
  25. mount:
  26. - ./node_modules
  27. volumes:
  28. - name: cache
  29. path: /cache
  30. - name: show tag
  31. image: alpine
  32. commands:
  33. - echo ${DRONE_BUILD_CREATED}
  34. - name: deploy Update
  35. image: node:12
  36. commands:
  37. - git config --global user.email "${DRONE_COMMIT_AUTHOR_EMAIL}"
  38. - git config --global user.name "${DRONE_COMMIT_AUTHOR}"
  39. - git clone https://gitea.frontblock.me/fb-dist/${DRONE_REPO_NAME}.git
  40. - rm -rf ./${DRONE_REPO_NAME}/*
  41. - cp -r ./dist/* ./${DRONE_REPO_NAME}
  42. - ls ./${DRONE_REPO_NAME}
  43. - cd ./${DRONE_REPO_NAME}
  44. - git add -A
  45. - git commit --allow-empty -m "drone tagged as version ${DRONE_TAG}"
  46. - git tag ${DRONE_TAG}
  47. - git status
  48. - git push https://$GIT_USER:$GIT_PASSWORD@gitea.frontblock.me/fb-dist/${DRONE_REPO_NAME}.git master ${DRONE_TAG}
  49. environment:
  50. GIT_USER:
  51. from_secret: git_user
  52. GIT_PASSWORD:
  53. from_secret: git_password
  54. when:
  55. event:
  56. - tag
  57. - name: deliver container
  58. image: plugins/docker
  59. settings:
  60. registry: registry.frontblock.me
  61. insecure: true
  62. repo: registry.frontblock.me/vendor/admin
  63. tags: ${DRONE_BUILD_CREATED}
  64. - name: release container
  65. image: plugins/docker
  66. settings:
  67. repo: frontblockme/admin
  68. tags: ${DRONE_TAG}
  69. username: frontblockme
  70. password:
  71. from_secret: docker_password
  72. when:
  73. event:
  74. - tag
  75. volumes:
  76. - name: cache
  77. host:
  78. path: /tmp