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

.drone.yml 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. kind: pipeline
  2. name: default
  3. - name: versioning
  4. image: node:12
  5. commands:
  6. - git config --global user.email "frontwork.me@gmail.com"
  7. - git config --global user.name "drone"
  8. - >
  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. steps:
  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