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.2KB

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