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

.drone.yml 2.5KB

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