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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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. 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.12
  220. pull: true
  221. secrets: [ docker_username, docker_password ]
  222. repo: gitea/gitea
  223. tags: [ '${DRONE_BRANCH##release/v}' ]
  224. when:
  225. event: [ push ]
  226. branch: [ release/* ]
  227. docker:
  228. image: plugins/docker:17.12
  229. secrets: [ docker_username, docker_password ]
  230. pull: true
  231. repo: gitea/gitea
  232. default_tags: true
  233. when:
  234. event: [ push, tag ]
  235. gpg-sign:
  236. image: plugins/gpgsign:1
  237. pull: true
  238. secrets: [ gpgsign_key, gpgsign_passphrase ]
  239. detach_sign: true
  240. files:
  241. - dist/release/*
  242. excludes:
  243. - dist/release/*.sha256
  244. when:
  245. event: [ push, 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_TAG##v}
  256. when:
  257. event: [ tag ]
  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/${DRONE_BRANCH##release/v}
  268. when:
  269. event: [ push ]
  270. branch: [ release/* ]
  271. release:
  272. image: plugins/s3:1
  273. pull: true
  274. secrets: [ aws_access_key_id, aws_secret_access_key ]
  275. bucket: releases
  276. endpoint: https://storage.gitea.io
  277. path_style: true
  278. strip_prefix: dist/release/
  279. source: dist/release/*
  280. target: /gitea/master
  281. when:
  282. event: [ push ]
  283. branch: [ master ]
  284. github:
  285. image: plugins/github-release:1
  286. pull: true
  287. secrets: [ github_token ]
  288. files:
  289. - dist/release/*
  290. when:
  291. event: [ tag ]
  292. upload_translations:
  293. image: jonasfranz/crowdin
  294. pull: true
  295. secrets: [ crowdin_key ]
  296. project_identifier: gitea
  297. ignore_branch: true
  298. download: false
  299. files:
  300. locale_en-US.ini: options/locale/locale_en-US.ini
  301. when:
  302. event: [ push ]
  303. branch: [ master ]
  304. discord:
  305. image: appleboy/drone-discord:1.0.0
  306. pull: true
  307. secrets: [ discord_webhook_id, discord_webhook_token ]
  308. when:
  309. event: [ push, tag, pull_request ]
  310. status: [ changed, failure ]
  311. services:
  312. mysql:
  313. image: mysql:5.7
  314. environment:
  315. - MYSQL_DATABASE=test
  316. - MYSQL_ALLOW_EMPTY_PASSWORD=yes
  317. when:
  318. event: [ push, tag, pull_request ]
  319. pgsql:
  320. image: postgres:9.5
  321. environment:
  322. - POSTGRES_DB=test
  323. when:
  324. event: [ push, tag, pull_request ]
  325. ldap:
  326. image: gitea/test-openldap:latest
  327. when:
  328. event: [ push, tag, pull_request ]