Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

.drone.yml 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. kind: pipeline
  2. name: default
  3. steps:
  4. - name: versioning
  5. image: node:12
  6. commands:
  7. - git config --global user.email "frontwork.me@gmail.com";
  8. - git config --global user.name "drone";
  9. - >
  10. if [ "${PACKAGE_VERSION}" != "${LATEST_VERSION}" ];
  11. then
  12. git tag $PACKAGE_VERSION
  13. git status
  14. git push https://$GIT_USER:$GIT_PASSWORD@gitea.frontblock.me/fw-vendor/${DRONE_REPO_NAME}.git $PACKAGE_VERSION;
  15. else
  16. echo 'Version '
  17. echo $LATEST_VERSION
  18. echo 'did not change. Don`t push tag to master';
  19. fi <
  20. - echo "${PACKAGE_VERSION}"
  21. - echo "${LATEST_VERSION}"
  22. environment:
  23. LATEST_VERSION:
  24. $(npm view rpclibrary | grep latest | head -1 | awk -F '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')
  25. PACKAGE_VERSION:
  26. $(cat package.json | grep version | head -1 | awk -F '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')
  27. GIT_USER:
  28. from_secret: git_user
  29. GIT_PASSWORD:
  30. from_secret: git_password
  31. trigger:
  32. event:
  33. exclude:
  34. - tag
  35. - name: restore cache
  36. image: drillster/drone-volume-cache
  37. settings:
  38. restore: true
  39. mount:
  40. - ./node_modules
  41. volumes:
  42. - name: cache
  43. path: /cache
  44. - name: npm install
  45. image: node:12
  46. commands:
  47. - npm install
  48. - name: npm run build
  49. image: node:12
  50. commands:
  51. - npm run build
  52. - name: rebuild cache
  53. image: drillster/drone-volume-cache
  54. settings:
  55. rebuild: true
  56. mount:
  57. - ./node_modules
  58. volumes:
  59. - name: cache
  60. path: /cache
  61. - name: show tag
  62. image: alpine
  63. commands:
  64. - echo ${DRONE_BUILD_CREATED}
  65. - name: npm run test
  66. image: node:12
  67. commands:
  68. - npm run test
  69. - name: rebuild documentation
  70. image: node:12
  71. commands:
  72. - rm -rf docs
  73. - npm run docs
  74. trigger:
  75. event:
  76. - tag
  77. - name: npm publish
  78. image: plugins/npm
  79. settings:
  80. username: frontwork
  81. password:
  82. from_secret: npm_password
  83. email: frontwork.me@gmail.com
  84. trigger:
  85. event:
  86. - tag
  87. - name: commit documentation
  88. image: node:12
  89. commands:
  90. - git config --global user.email "frontwork.me@gmail.com"
  91. - git config --global user.name "drone"
  92. - git add -f docs
  93. - git commit --allow-empty -m "documented version at ${DRONE_BUILD_CREATED}"
  94. - git tag ${DRONE_BUILD_CREATED}
  95. - git status
  96. - git push https://$GIT_USER:$GIT_PASSWORD@gitea.frontblock.me/fw-vendor/${DRONE_REPO_NAME}.git master ${DRONE_BUILD_CREATED}
  97. environment:
  98. GIT_USER:
  99. from_secret: git_user
  100. GIT_PASSWORD:
  101. from_secret: git_password
  102. trigger:
  103. event:
  104. - tag
  105. volumes:
  106. - name: cache
  107. host:
  108. path: /tmp