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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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. TEST_LDAP: "1"
  126. commands:
  127. - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  128. - apt-get install -y git-lfs
  129. - make integration-test-coverage
  130. when:
  131. event: [ push, pull_request ]
  132. branch: [ master ]
  133. test-mysql:
  134. image: golang:1.10
  135. pull: true
  136. group: test
  137. environment:
  138. TAGS: bindata
  139. TEST_LDAP: "1"
  140. commands:
  141. - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  142. - apt-get install -y git-lfs
  143. - make test-mysql
  144. when:
  145. event: [ tag ]
  146. test-pgsql:
  147. image: golang:1.10
  148. pull: true
  149. group: test
  150. environment:
  151. TAGS: bindata
  152. TEST_LDAP: "1"
  153. commands:
  154. - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  155. - apt-get install -y git-lfs
  156. - make test-pgsql
  157. when:
  158. event: [ push, tag, pull_request ]
  159. generate-coverage:
  160. image: golang:1.10
  161. pull: true
  162. environment:
  163. TAGS: bindata
  164. commands:
  165. - make coverage
  166. when:
  167. event: [ push, pull_request ]
  168. branch: [ master ]
  169. coverage:
  170. image: robertstettner/drone-codecov
  171. secrets: [ codecov_token ]
  172. files:
  173. - coverage.all
  174. when:
  175. event: [ push, pull_request ]
  176. branch: [ master ]
  177. static:
  178. image: karalabe/xgo-latest:latest
  179. pull: true
  180. environment:
  181. TAGS: bindata sqlite
  182. commands:
  183. - make release
  184. when:
  185. event: [ push, tag ]
  186. build_docs:
  187. image: webhippie/hugo:latest
  188. pull: true
  189. commands:
  190. - cd docs
  191. - make trans-copy
  192. - make clean
  193. - make build
  194. docker_docs:
  195. image: plugins/docker:17.05
  196. pull: true
  197. secrets: [ docker_username, docker_password ]
  198. repo: gitea/docs
  199. context: docs
  200. dockerfile: docs/Dockerfile
  201. tags: [ '${DRONE_BRANCH##release/v}' ]
  202. when:
  203. event: [ push ]
  204. branch: [ release/* ]
  205. docker_docs:
  206. image: plugins/docker:17.05
  207. pull: true
  208. secrets: [ docker_username, docker_password ]
  209. repo: gitea/docs
  210. context: docs
  211. dockerfile: docs/Dockerfile
  212. tags: [ 'latest' ]
  213. when:
  214. event: [ push ]
  215. branch: [ master ]
  216. docker:
  217. image: plugins/docker:17.12
  218. pull: true
  219. secrets: [ docker_username, docker_password ]
  220. repo: gitea/gitea
  221. tags: [ '${DRONE_BRANCH##release/v}' ]
  222. when:
  223. event: [ push ]
  224. branch: [ release/* ]
  225. docker:
  226. image: plugins/docker:17.12
  227. secrets: [ docker_username, docker_password ]
  228. pull: true
  229. repo: gitea/gitea
  230. default_tags: true
  231. when:
  232. event: [ push, tag ]
  233. release:
  234. image: plugins/s3:1
  235. pull: true
  236. secrets: [ aws_access_key_id, aws_secret_access_key ]
  237. bucket: releases
  238. endpoint: https://storage.gitea.io
  239. path_style: true
  240. strip_prefix: dist/release/
  241. source: dist/release/*
  242. target: /gitea/${DRONE_TAG##v}
  243. when:
  244. event: [ tag ]
  245. release:
  246. image: plugins/s3:1
  247. pull: true
  248. secrets: [ aws_access_key_id, aws_secret_access_key ]
  249. bucket: releases
  250. endpoint: https://storage.gitea.io
  251. path_style: true
  252. strip_prefix: dist/release/
  253. source: dist/release/*
  254. target: /gitea/${DRONE_BRANCH##release/v}
  255. when:
  256. event: [ push ]
  257. branch: [ release/* ]
  258. release:
  259. image: plugins/s3:1
  260. pull: true
  261. secrets: [ aws_access_key_id, aws_secret_access_key ]
  262. bucket: releases
  263. endpoint: https://storage.gitea.io
  264. path_style: true
  265. strip_prefix: dist/release/
  266. source: dist/release/*
  267. target: /gitea/master
  268. when:
  269. event: [ push ]
  270. branch: [ master ]
  271. github:
  272. image: plugins/github-release:1
  273. pull: true
  274. secrets: [ github_token ]
  275. files:
  276. - dist/release/*
  277. when:
  278. event: [ tag ]
  279. upload_translations:
  280. image: jonasfranz/crowdin
  281. pull: true
  282. secrets: [ crowdin_key ]
  283. project_identifier: gitea
  284. ignore_branch: true
  285. download: false
  286. files:
  287. locale_en-US.ini: options/locale/locale_en-US.ini
  288. when:
  289. event: [ push ]
  290. branch: [ master ]
  291. discord:
  292. image: appleboy/drone-discord:1.0.0
  293. pull: true
  294. secrets: [ discord_webhook_id, discord_webhook_token ]
  295. when:
  296. event: [ push, tag, pull_request ]
  297. status: [ changed, failure ]
  298. services:
  299. mysql:
  300. image: mysql:5.7
  301. environment:
  302. - MYSQL_DATABASE=test
  303. - MYSQL_ALLOW_EMPTY_PASSWORD=yes
  304. when:
  305. event: [ push, tag, pull_request ]
  306. pgsql:
  307. image: postgres:9.5
  308. environment:
  309. - POSTGRES_DB=test
  310. when:
  311. event: [ push, tag, pull_request ]
  312. ldap:
  313. image: gitea/test-openldap:latest
  314. when:
  315. event: [ push, tag, pull_request ]