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.

347 lines
7.4 KiB

  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. - export PATH=$PATH:$GOPATH/bin
  184. - make release
  185. when:
  186. event: [ push, tag ]
  187. build_docs:
  188. image: webhippie/hugo:latest
  189. pull: true
  190. commands:
  191. - cd docs
  192. - make trans-copy
  193. - make clean
  194. - make build
  195. docker_docs:
  196. image: plugins/docker:17.05
  197. pull: true
  198. secrets: [ docker_username, docker_password ]
  199. repo: gitea/docs
  200. context: docs
  201. dockerfile: docs/Dockerfile
  202. tags: [ '${DRONE_BRANCH##release/v}' ]
  203. when:
  204. event: [ push ]
  205. branch: [ release/* ]
  206. docker_docs:
  207. image: plugins/docker:17.05
  208. pull: true
  209. secrets: [ docker_username, docker_password ]
  210. repo: gitea/docs
  211. context: docs
  212. dockerfile: docs/Dockerfile
  213. tags: [ 'latest' ]
  214. when:
  215. event: [ push ]
  216. branch: [ master ]
  217. docker:
  218. image: plugins/docker:17.12
  219. pull: true
  220. secrets: [ docker_username, docker_password ]
  221. repo: gitea/gitea
  222. tags: [ '${DRONE_BRANCH##release/v}' ]
  223. when:
  224. event: [ push ]
  225. branch: [ release/* ]
  226. docker:
  227. image: plugins/docker:17.12
  228. secrets: [ docker_username, docker_password ]
  229. pull: true
  230. repo: gitea/gitea
  231. default_tags: true
  232. when:
  233. event: [ push, tag ]
  234. release:
  235. image: plugins/s3:1
  236. pull: true
  237. secrets: [ aws_access_key_id, aws_secret_access_key ]
  238. bucket: releases
  239. endpoint: https://storage.gitea.io
  240. path_style: true
  241. strip_prefix: dist/release/
  242. source: dist/release/*
  243. target: /gitea/${DRONE_TAG##v}
  244. when:
  245. event: [ tag ]
  246. release:
  247. image: plugins/s3:1
  248. pull: true
  249. secrets: [ aws_access_key_id, aws_secret_access_key ]
  250. bucket: releases
  251. endpoint: https://storage.gitea.io
  252. path_style: true
  253. strip_prefix: dist/release/
  254. source: dist/release/*
  255. target: /gitea/${DRONE_BRANCH##release/v}
  256. when:
  257. event: [ push ]
  258. branch: [ release/* ]
  259. release:
  260. image: plugins/s3:1
  261. pull: true
  262. secrets: [ aws_access_key_id, aws_secret_access_key ]
  263. bucket: releases
  264. endpoint: https://storage.gitea.io
  265. path_style: true
  266. strip_prefix: dist/release/
  267. source: dist/release/*
  268. target: /gitea/master
  269. when:
  270. event: [ push ]
  271. branch: [ master ]
  272. github:
  273. image: plugins/github-release:1
  274. pull: true
  275. secrets: [ github_token ]
  276. files:
  277. - dist/release/*
  278. when:
  279. event: [ tag ]
  280. upload_translations:
  281. image: jonasfranz/crowdin
  282. pull: true
  283. secrets: [ crowdin_key ]
  284. project_identifier: gitea
  285. ignore_branch: true
  286. download: false
  287. files:
  288. locale_en-US.ini: options/locale/locale_en-US.ini
  289. when:
  290. event: [ push ]
  291. branch: [ master ]
  292. discord:
  293. image: appleboy/drone-discord:1.0.0
  294. pull: true
  295. secrets: [ discord_webhook_id, discord_webhook_token ]
  296. when:
  297. event: [ push, tag, pull_request ]
  298. status: [ changed, failure ]
  299. services:
  300. mysql:
  301. image: mysql:5.7
  302. environment:
  303. - MYSQL_DATABASE=test
  304. - MYSQL_ALLOW_EMPTY_PASSWORD=yes
  305. when:
  306. event: [ push, tag, pull_request ]
  307. pgsql:
  308. image: postgres:9.5
  309. environment:
  310. - POSTGRES_DB=test
  311. when:
  312. event: [ push, tag, pull_request ]
  313. ldap:
  314. image: gitea/test-openldap:latest
  315. when:
  316. event: [ push, tag, pull_request ]