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:next
  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 swagger-validate
  72. - make misspell-check
  73. - make test-vendor
  74. - make build
  75. when:
  76. event: [ push, tag, pull_request ]
  77. test:
  78. image: golang:1.10
  79. pull: true
  80. group: test
  81. environment:
  82. TAGS: bindata sqlite
  83. commands:
  84. - make unit-test-coverage
  85. when:
  86. event: [ push, pull_request ]
  87. branch: [ master ]
  88. test:
  89. image: golang:1.10
  90. pull: true
  91. group: test
  92. environment:
  93. TAGS: bindata sqlite
  94. commands:
  95. - make test
  96. when:
  97. event: [ push, pull_request ]
  98. branch: [ release/* ]
  99. test:
  100. image: golang:1.10
  101. pull: true
  102. group: test
  103. environment:
  104. TAGS: bindata
  105. commands:
  106. - make test
  107. when:
  108. event: [ tag ]
  109. # Commented until db locking have been resolved!
  110. # test-sqlite:
  111. # image: golang:1.10
  112. # pull: true
  113. # group: test
  114. # environment:
  115. # TAGS: bindata
  116. # commands:
  117. # - make test-sqlite
  118. # when:
  119. # event: [ push, tag, pull_request ]
  120. test-mysql:
  121. image: golang:1.10
  122. pull: true
  123. group: test
  124. environment:
  125. TAGS: bindata
  126. TEST_LDAP: "1"
  127. commands:
  128. - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  129. - apt-get install -y git-lfs
  130. - make integration-test-coverage
  131. when:
  132. event: [ push, pull_request ]
  133. branch: [ master ]
  134. test-mysql:
  135. image: golang:1.10
  136. pull: true
  137. group: test
  138. environment:
  139. TAGS: bindata
  140. TEST_LDAP: "1"
  141. commands:
  142. - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  143. - apt-get install -y git-lfs
  144. - make test-mysql
  145. when:
  146. event: [ tag ]
  147. test-pgsql:
  148. image: golang:1.10
  149. pull: true
  150. group: test
  151. environment:
  152. TAGS: bindata
  153. TEST_LDAP: "1"
  154. commands:
  155. - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  156. - apt-get install -y git-lfs
  157. - make test-pgsql
  158. when:
  159. event: [ push, tag, pull_request ]
  160. generate-coverage:
  161. image: golang:1.10
  162. pull: true
  163. environment:
  164. TAGS: bindata
  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. commands:
  184. - export PATH=$PATH:$GOPATH/bin
  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. publish-docs:
  197. image: lucap/drone-netlify:latest
  198. pull: true
  199. secrets: [ netlify_token ]
  200. site_id: d2260bae-7861-4c02-8646-8f6440b12672
  201. path: docs/public/
  202. when:
  203. event: [ push ]
  204. branch: [ master ]
  205. docker:
  206. image: plugins/docker:17.12
  207. pull: true
  208. secrets: [ docker_username, docker_password ]
  209. repo: gitea/gitea
  210. tags: [ '${DRONE_BRANCH##release/v}' ]
  211. when:
  212. event: [ push ]
  213. branch: [ release/* ]
  214. docker:
  215. image: plugins/docker:17.12
  216. secrets: [ docker_username, docker_password ]
  217. pull: true
  218. repo: gitea/gitea
  219. default_tags: true
  220. when:
  221. event: [ push, tag ]
  222. gpg-sign:
  223. image: plugins/gpgsign:1
  224. pull: true
  225. secrets: [ gpgsign_key, gpgsign_passphrase ]
  226. detach_sign: true
  227. files:
  228. - dist/release/*
  229. excludes:
  230. - dist/release/*.sha256
  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 ]