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

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