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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  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-without-gcc:
  53. image: webhippie/golang:edge
  54. pull: true
  55. environment:
  56. GOPATH: /srv/app
  57. commands:
  58. - go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
  59. when:
  60. event: [ push, tag, pull_request ]
  61. build:
  62. image: webhippie/golang:edge
  63. pull: true
  64. environment:
  65. TAGS: bindata sqlite
  66. GOPATH: /srv/app
  67. commands:
  68. - make clean
  69. - make generate
  70. - make vet
  71. - make lint
  72. - make fmt-check
  73. - make misspell-check
  74. - make test-vendor
  75. - make build
  76. when:
  77. event: [ push, tag, pull_request ]
  78. test:
  79. image: webhippie/golang:edge
  80. pull: true
  81. group: test
  82. environment:
  83. TAGS: bindata sqlite
  84. GOPATH: /srv/app
  85. commands:
  86. - make unit-test-coverage
  87. when:
  88. event: [ push, pull_request ]
  89. branch: [ master ]
  90. test:
  91. image: webhippie/golang:edge
  92. pull: true
  93. group: test
  94. environment:
  95. TAGS: bindata sqlite
  96. GOPATH: /srv/app
  97. commands:
  98. - make test
  99. when:
  100. event: [ push, pull_request ]
  101. branch: [ release/* ]
  102. test:
  103. image: webhippie/golang:edge
  104. pull: true
  105. group: test
  106. environment:
  107. TAGS: bindata
  108. GOPATH: /srv/app
  109. commands:
  110. - make test
  111. when:
  112. event: [ tag ]
  113. # Commented until db locking have been resolved!
  114. # test-sqlite:
  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-sqlite
  123. # when:
  124. # event: [ push, tag, pull_request ]
  125. test-mysql:
  126. image: webhippie/golang:edge
  127. pull: true
  128. group: test
  129. environment:
  130. TAGS: bindata
  131. GOPATH: /srv/app
  132. commands:
  133. - make integration-test-coverage
  134. when:
  135. event: [ push, pull_request ]
  136. branch: [ master ]
  137. test-mysql:
  138. image: webhippie/golang:edge
  139. pull: true
  140. group: test
  141. environment:
  142. TAGS: bindata
  143. GOPATH: /srv/app
  144. commands:
  145. - make test-mysql
  146. when:
  147. event: [ tag ]
  148. test-pgsql:
  149. image: webhippie/golang:edge
  150. pull: true
  151. group: test
  152. environment:
  153. TAGS: bindata
  154. GOPATH: /srv/app
  155. commands:
  156. - make test-pgsql
  157. when:
  158. event: [ push, tag, pull_request ]
  159. generate-coverage:
  160. image: webhippie/golang:edge
  161. pull: true
  162. environment:
  163. TAGS: bindata
  164. GOPATH: /srv/app
  165. commands:
  166. - make coverage
  167. when:
  168. event: [ push, pull_request ]
  169. branch: [ master ]
  170. coverage:
  171. image: robertstettner/drone-codecov
  172. secrets: [ codecov_token ]
  173. files:
  174. - coverage.all
  175. when:
  176. event: [ push, pull_request ]
  177. branch: [ master ]
  178. static:
  179. image: karalabe/xgo-latest:latest
  180. pull: true
  181. environment:
  182. TAGS: bindata sqlite
  183. GOPATH: /srv/app
  184. commands:
  185. - make release
  186. when:
  187. event: [ push, tag ]
  188. build_docs:
  189. image: webhippie/hugo:latest
  190. pull: true
  191. commands:
  192. - cd docs
  193. - make trans-copy
  194. - make clean
  195. - make build
  196. docker_docs:
  197. image: plugins/docker:17.05
  198. pull: true
  199. secrets: [ docker_username, docker_password ]
  200. repo: gitea/docs
  201. context: docs
  202. dockerfile: docs/Dockerfile
  203. tags: [ '${DRONE_BRANCH##release/v}' ]
  204. when:
  205. event: [ push ]
  206. branch: [ release/* ]
  207. docker_docs:
  208. image: plugins/docker:17.05
  209. pull: true
  210. secrets: [ docker_username, docker_password ]
  211. repo: gitea/docs
  212. context: docs
  213. dockerfile: docs/Dockerfile
  214. tags: [ 'latest' ]
  215. when:
  216. event: [ push ]
  217. branch: [ master ]
  218. docker:
  219. image: plugins/docker:17.05
  220. pull: true
  221. secrets: [ docker_username, docker_password ]
  222. repo: gitea/gitea
  223. tags: [ '${DRONE_TAG##v}' ]
  224. when:
  225. event: [ tag ]
  226. docker:
  227. image: plugins/docker:17.05
  228. pull: true
  229. secrets: [ docker_username, docker_password ]
  230. repo: gitea/gitea
  231. tags: [ '${DRONE_BRANCH##release/v}' ]
  232. when:
  233. event: [ push ]
  234. branch: [ release/* ]
  235. docker:
  236. image: plugins/docker:17.05
  237. pull: true
  238. secrets: [ docker_username, docker_password ]
  239. repo: gitea/gitea
  240. tags: [ 'latest' ]
  241. when:
  242. event: [ push ]
  243. branch: [ master ]
  244. release:
  245. image: plugins/s3:1
  246. pull: true
  247. secrets: [ aws_access_key_id, aws_secret_access_key ]
  248. bucket: releases
  249. endpoint: https://storage.gitea.io
  250. path_style: true
  251. strip_prefix: dist/release/
  252. source: dist/release/*
  253. target: /gitea/${DRONE_TAG##v}
  254. when:
  255. event: [ tag ]
  256. release:
  257. image: plugins/s3:1
  258. pull: true
  259. secrets: [ aws_access_key_id, aws_secret_access_key ]
  260. bucket: releases
  261. endpoint: https://storage.gitea.io
  262. path_style: true
  263. strip_prefix: dist/release/
  264. source: dist/release/*
  265. target: /gitea/${DRONE_BRANCH##release/v}
  266. when:
  267. event: [ push ]
  268. branch: [ release/* ]
  269. release:
  270. image: plugins/s3:1
  271. pull: true
  272. secrets: [ aws_access_key_id, aws_secret_access_key ]
  273. bucket: releases
  274. endpoint: https://storage.gitea.io
  275. path_style: true
  276. strip_prefix: dist/release/
  277. source: dist/release/*
  278. target: /gitea/master
  279. when:
  280. event: [ push ]
  281. branch: [ master ]
  282. github:
  283. image: plugins/github-release:1
  284. pull: true
  285. secrets: [ github_token ]
  286. files:
  287. - dist/release/*
  288. when:
  289. event: [ tag ]
  290. upload_translations:
  291. image: jonasfranz/crowdin
  292. pull: true
  293. secrets: [ crowdin_key ]
  294. project_identifier: gitea
  295. ignore_branch: true
  296. download: false
  297. files:
  298. locale_en-US.ini: options/locale/locale_en-US.ini
  299. when:
  300. event: [ push ]
  301. branch: [ master ]
  302. discord:
  303. image: appleboy/drone-discord:1.0.0
  304. pull: true
  305. secrets: [ discord_webhook_id, discord_webhook_token ]
  306. when:
  307. event: [ push, tag, pull_request ]
  308. status: [ changed, failure ]
  309. services:
  310. mysql:
  311. image: mysql:5.7
  312. environment:
  313. - MYSQL_DATABASE=test
  314. - MYSQL_ALLOW_EMPTY_PASSWORD=yes
  315. when:
  316. event: [ push, tag, pull_request ]
  317. pgsql:
  318. image: postgres:9.5
  319. environment:
  320. - POSTGRES_DB=test
  321. when:
  322. event: [ push, tag, pull_request ]