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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. workspace:
  2. base: /srv/app
  3. path: src/code.gitea.io/gitea
  4. clone:
  5. git:
  6. image: plugins/git:1
  7. depth: 50
  8. tags: true
  9. pipeline:
  10. download_translations:
  11. image: jonasfranz/crowdin
  12. pull: true
  13. secrets: [ crowdin_key ]
  14. project_identifier: gitea
  15. ignore_branch: true
  16. download: true
  17. export_dir: options/locale/
  18. when:
  19. event: [ push ]
  20. branch: [ master ]
  21. update-translations:
  22. image: alpine:3.6
  23. commands:
  24. - mv ./options/locale/locale_en-US.ini ./options/
  25. - sed -i -e 's/="/=/g' -e 's/"$$//g' ./options/locale/*.ini
  26. - sed -i -e 's/\\\\"/"/g' ./options/locale/*.ini
  27. - mv ./options/locale_en-US.ini ./options/locale/
  28. when:
  29. event: [ push ]
  30. branch: [ master ]
  31. git_push:
  32. image: appleboy/drone-git-push
  33. pull: true
  34. secrets: [ git_push_ssh_key ]
  35. remote: git@github.com:go-gitea/gitea.git
  36. force: false
  37. commit: true
  38. commit_message: "[skip ci] Updated translations via Crowdin"
  39. when:
  40. event: [ push ]
  41. branch: [ master ]
  42. pre-build:
  43. image: webhippie/nodejs:latest
  44. pull: true
  45. commands:
  46. - npm install
  47. - make stylesheets-check
  48. when:
  49. event: [ push, tag, pull_request ]
  50. build:
  51. image: webhippie/golang:edge
  52. pull: true
  53. environment:
  54. TAGS: bindata sqlite
  55. GOPATH: /srv/app
  56. commands:
  57. - make clean
  58. - make generate
  59. - make vet
  60. - make lint
  61. - make fmt-check
  62. - make misspell-check
  63. - make test-vendor
  64. - make build
  65. when:
  66. event: [ push, tag, pull_request ]
  67. test:
  68. image: webhippie/golang:edge
  69. pull: true
  70. group: test
  71. environment:
  72. TAGS: bindata sqlite
  73. GOPATH: /srv/app
  74. commands:
  75. - make unit-test-coverage
  76. when:
  77. event: [ push, pull_request ]
  78. branch: [ master ]
  79. test:
  80. image: webhippie/golang:edge
  81. pull: true
  82. group: test
  83. environment:
  84. TAGS: bindata
  85. GOPATH: /srv/app
  86. commands:
  87. - make test
  88. when:
  89. event: [ tag ]
  90. # Commented until db locking have been resolved!
  91. # test-sqlite:
  92. # image: webhippie/golang:edge
  93. # pull: true
  94. # group: test
  95. # environment:
  96. # TAGS: bindata
  97. # GOPATH: /srv/app
  98. # commands:
  99. # - make test-sqlite
  100. # when:
  101. # event: [ push, tag, pull_request ]
  102. test-mysql:
  103. image: webhippie/golang:edge
  104. pull: true
  105. group: test
  106. environment:
  107. TAGS: bindata
  108. GOPATH: /srv/app
  109. commands:
  110. - make integration-test-coverage
  111. when:
  112. event: [ push, pull_request ]
  113. branch: [ master ]
  114. test-mysql:
  115. image: webhippie/golang:edge
  116. pull: true
  117. group: test
  118. environment:
  119. TAGS: bindata
  120. GOPATH: /srv/app
  121. commands:
  122. - make test-mysql
  123. when:
  124. event: [ tag ]
  125. test-pgsql:
  126. image: webhippie/golang:edge
  127. pull: true
  128. group: test
  129. environment:
  130. TAGS: bindata
  131. GOPATH: /srv/app
  132. commands:
  133. - make test-pgsql
  134. when:
  135. event: [ push, tag, pull_request ]
  136. generate-coverage:
  137. image: webhippie/golang:edge
  138. pull: true
  139. environment:
  140. TAGS: bindata
  141. GOPATH: /srv/app
  142. commands:
  143. - make coverage
  144. when:
  145. event: [ push, pull_request ]
  146. branch: [ master ]
  147. coverage:
  148. image: robertstettner/drone-codecov
  149. secrets: [ codecov_token ]
  150. files:
  151. - coverage.all
  152. when:
  153. event: [ push, pull_request ]
  154. branch: [ master ]
  155. static:
  156. image: karalabe/xgo-latest:latest
  157. pull: true
  158. environment:
  159. TAGS: bindata sqlite
  160. GOPATH: /srv/app
  161. commands:
  162. - make release
  163. when:
  164. event: [ push, tag ]
  165. docker:
  166. image: plugins/docker:17.05
  167. pull: true
  168. secrets: [ docker_username, docker_password ]
  169. repo: gitea/gitea
  170. tags: [ '${DRONE_TAG##v}' ]
  171. when:
  172. event: [ tag ]
  173. docker:
  174. image: plugins/docker:17.05
  175. pull: true
  176. secrets: [ docker_username, docker_password ]
  177. repo: gitea/gitea
  178. tags: [ '${DRONE_BRANCH##release/v}' ]
  179. when:
  180. event: [ push ]
  181. branch: [ release/* ]
  182. docker:
  183. image: plugins/docker:17.05
  184. pull: true
  185. secrets: [ docker_username, docker_password ]
  186. repo: gitea/gitea
  187. tags: [ 'latest' ]
  188. when:
  189. event: [ push ]
  190. branch: [ master ]
  191. release:
  192. image: plugins/s3:1
  193. pull: true
  194. secrets: [ aws_access_key_id, aws_secret_access_key ]
  195. bucket: releases
  196. endpoint: https://storage.gitea.io
  197. path_style: true
  198. strip_prefix: dist/release/
  199. source: dist/release/*
  200. target: /gitea/${DRONE_TAG##v}
  201. when:
  202. event: [ tag ]
  203. release:
  204. image: plugins/s3:1
  205. pull: true
  206. secrets: [ aws_access_key_id, aws_secret_access_key ]
  207. bucket: releases
  208. endpoint: https://storage.gitea.io
  209. path_style: true
  210. strip_prefix: dist/release/
  211. source: dist/release/*
  212. target: /gitea/${DRONE_BRANCH##release/v}
  213. when:
  214. event: [ push ]
  215. branch: [ release/* ]
  216. release:
  217. image: plugins/s3:1
  218. pull: true
  219. secrets: [ aws_access_key_id, aws_secret_access_key ]
  220. bucket: releases
  221. endpoint: https://storage.gitea.io
  222. path_style: true
  223. strip_prefix: dist/release/
  224. source: dist/release/*
  225. target: /gitea/master
  226. when:
  227. event: [ push ]
  228. branch: [ master ]
  229. github:
  230. image: plugins/github-release:1
  231. pull: true
  232. secrets: [ github_token ]
  233. files:
  234. - dist/release/*
  235. when:
  236. event: [ tag ]
  237. upload_translations:
  238. image: jonasfranz/crowdin
  239. pull: true
  240. secrets: [ crowdin_key ]
  241. project_identifier: gitea
  242. ignore_branch: true
  243. download: false
  244. files:
  245. locale_en-US.ini: options/locale/locale_en-US.ini
  246. when:
  247. event: [ push ]
  248. branch: [ master ]
  249. discord:
  250. image: appleboy/drone-discord:1.0.0
  251. pull: true
  252. secrets: [ discord_webhook_id, discord_webhook_token ]
  253. when:
  254. event: [ push, tag, pull_request ]
  255. status: [ changed, failure ]
  256. services:
  257. mysql:
  258. image: mysql:5.7
  259. environment:
  260. - MYSQL_DATABASE=test
  261. - MYSQL_ALLOW_EMPTY_PASSWORD=yes
  262. when:
  263. event: [ push, tag, pull_request ]
  264. pgsql:
  265. image: postgres:9.5
  266. environment:
  267. - POSTGRES_DB=test
  268. when:
  269. event: [ push, tag, pull_request ]