.drone.yml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  1. workspace:
  2. base: /go
  3. path: src/code.gitea.io/gitea
  4. pipeline:
  5. fetch-tags:
  6. image: docker:git
  7. commands:
  8. - git fetch --tags --force
  9. when:
  10. event:
  11. exclude: [ pull_request ]
  12. download_translations:
  13. image: jonasfranz/crowdin
  14. pull: true
  15. secrets: [ crowdin_key ]
  16. project_identifier: gitea
  17. ignore_branch: true
  18. download: true
  19. export_dir: options/locale/
  20. when:
  21. event: [ push ]
  22. branch: [ master ]
  23. update-translations:
  24. image: alpine:3.10
  25. commands:
  26. - mv ./options/locale/locale_en-US.ini ./options/
  27. - sed -i -e 's/="/=/g' -e 's/"$$//g' ./options/locale/*.ini
  28. - sed -i -e 's/\\\\"/"/g' ./options/locale/*.ini
  29. - mv ./options/locale_en-US.ini ./options/locale/
  30. when:
  31. event: [ push ]
  32. branch: [ master ]
  33. git_push:
  34. image: appleboy/drone-git-push
  35. pull: true
  36. secrets: [ git_push_ssh_key ]
  37. remote: git@github.com:go-gitea/gitea.git
  38. force: false
  39. commit: true
  40. commit_message: "[skip ci] Updated translations via Crowdin"
  41. author_name: GiteaBot
  42. author_email: teabot@gitea.io
  43. when:
  44. event: [ push ]
  45. branch: [ master ]
  46. pre-build:
  47. image: webhippie/nodejs:latest
  48. pull: true
  49. commands:
  50. - make css
  51. - make js
  52. when:
  53. event: [ push, tag, pull_request ]
  54. build-without-gcc:
  55. image: golang:1.10 # this step is kept as the lowest version of golang that we support
  56. pull: true
  57. commands:
  58. - go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
  59. when:
  60. event: [ push, tag, pull_request ]
  61. build:
  62. image: golang:1.12
  63. pull: true
  64. environment:
  65. TAGS: bindata sqlite sqlite_unlock_notify
  66. commands:
  67. - make clean
  68. - make generate
  69. - make golangci-lint
  70. - make revive
  71. - make swagger-check
  72. - make swagger-validate
  73. - make test-vendor
  74. - make build
  75. when:
  76. event: [ push, tag, pull_request ]
  77. unit-test:
  78. image: golang:1.12
  79. pull: true
  80. group: test
  81. environment:
  82. TAGS: bindata sqlite sqlite_unlock_notify
  83. commands:
  84. - make unit-test-coverage
  85. when:
  86. event: [ push, pull_request ]
  87. branch: [ master ]
  88. release-test:
  89. image: golang:1.12
  90. pull: true
  91. group: test
  92. environment:
  93. TAGS: bindata sqlite sqlite_unlock_notify
  94. commands:
  95. - make test
  96. when:
  97. event: [ push, pull_request ]
  98. branch: [ release/* ]
  99. tag-test:
  100. image: golang:1.12
  101. pull: true
  102. group: test
  103. environment:
  104. TAGS: bindata
  105. commands:
  106. - make test
  107. when:
  108. event: [ tag ]
  109. test-sqlite:
  110. image: golang:1.12
  111. pull: true
  112. group: test
  113. environment:
  114. TAGS: bindata
  115. commands:
  116. - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  117. - apt-get install -y git-lfs
  118. - timeout -s ABRT 20m make test-sqlite-migration
  119. - timeout -s ABRT 20m make test-sqlite
  120. when:
  121. event: [ push, tag, pull_request ]
  122. test-mysql:
  123. image: golang:1.12
  124. pull: true
  125. group: test
  126. environment:
  127. TAGS: bindata
  128. TEST_LDAP: "1"
  129. commands:
  130. - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  131. - apt-get install -y git-lfs
  132. - make test-mysql-migration
  133. - make integration-test-coverage
  134. when:
  135. event: [ push, pull_request ]
  136. branch: [ master ]
  137. tag-test-mysql:
  138. image: golang:1.12
  139. pull: true
  140. group: test
  141. environment:
  142. TAGS: bindata
  143. TEST_LDAP: "1"
  144. commands:
  145. - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  146. - apt-get install -y git-lfs
  147. - timeout -s ABRT 20m make test-mysql-migration
  148. - timeout -s ABRT 20m make test-mysql
  149. when:
  150. event: [ tag ]
  151. test-mysql8:
  152. image: golang:1.12
  153. pull: true
  154. group: test
  155. environment:
  156. TAGS: bindata
  157. TEST_LDAP: "1"
  158. commands:
  159. - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  160. - apt-get install -y git-lfs
  161. - timeout -s ABRT 20m make test-mysql8-migration
  162. - timeout -s ABRT 20m make test-mysql8
  163. when:
  164. event: [ push, tag, pull_request ]
  165. test-pgsql:
  166. image: golang:1.12
  167. pull: true
  168. group: test
  169. environment:
  170. TAGS: bindata
  171. TEST_LDAP: "1"
  172. commands:
  173. - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  174. - apt-get install -y git-lfs
  175. - timeout -s ABRT 20m make test-pgsql-migration
  176. - timeout -s ABRT 20m make test-pgsql
  177. when:
  178. event: [ push, tag, pull_request ]
  179. test-mssql:
  180. image: golang:1.12
  181. pull: true
  182. group: test
  183. environment:
  184. TAGS: bindata
  185. TEST_LDAP: "1"
  186. commands:
  187. - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  188. - apt-get install -y git-lfs
  189. - make test-mssql-migration
  190. - make test-mssql
  191. when:
  192. event: [ push, tag, pull_request ]
  193. # bench-sqlite:
  194. # image: golang:1.12
  195. # pull: true
  196. # group: bench
  197. # commands:
  198. # - make bench-sqlite
  199. # when:
  200. # event: [ tag ]
  201. # bench-mysql:
  202. # image: golang:1.12
  203. # pull: true
  204. # group: bench
  205. # commands:
  206. # - make bench-mysql
  207. # when:
  208. # event: [ tag ]
  209. # bench-mssql:
  210. # image: golang:1.12
  211. # pull: true
  212. # group: bench
  213. # commands:
  214. # - make bench-mssql
  215. # when:
  216. # event: [ tag ]
  217. # bench-pgsql:
  218. # image: golang:1.12
  219. # pull: true
  220. # group: bench
  221. # commands:
  222. # - make bench-pgsql
  223. # when:
  224. # event: [ tag ]
  225. generate-coverage:
  226. image: golang:1.12
  227. pull: true
  228. environment:
  229. TAGS: bindata
  230. commands:
  231. - make coverage
  232. when:
  233. event: [ push, pull_request ]
  234. branch: [ master ]
  235. coverage:
  236. image: robertstettner/drone-codecov
  237. secrets: [ codecov_token ]
  238. files:
  239. - coverage.all
  240. when:
  241. event: [ push, pull_request ]
  242. branch: [ master ]
  243. static:
  244. image: techknowlogick/xgo:latest
  245. pull: true
  246. environment:
  247. TAGS: bindata sqlite sqlite_unlock_notify
  248. commands:
  249. - export PATH=$PATH:$GOPATH/bin
  250. - make release
  251. when:
  252. event: [ push, tag ]
  253. build-docs:
  254. image: webhippie/hugo:latest
  255. pull: true
  256. commands:
  257. - cd docs
  258. - make trans-copy
  259. - make clean
  260. - make build
  261. publish-docs:
  262. image: lucap/drone-netlify:latest
  263. pull: true
  264. secrets: [ netlify_token ]
  265. site_id: d2260bae-7861-4c02-8646-8f6440b12672
  266. path: docs/public/
  267. when:
  268. event: [ push ]
  269. branch: [ master ]
  270. docker-dryrun:
  271. image: plugins/docker:18.09
  272. pull: true
  273. repo: gitea/gitea
  274. cache_from: gitea/gitea
  275. dry_run: true
  276. when:
  277. event: [ pull_request ]
  278. release-docker:
  279. image: plugins/docker:18.09
  280. pull: true
  281. secrets: [ docker_username, docker_password ]
  282. repo: gitea/gitea
  283. tags: [ '${DRONE_BRANCH##release/v}' ]
  284. cache_from: gitea/gitea
  285. when:
  286. event: [ push ]
  287. branch: [ release/* ]
  288. docker:
  289. image: plugins/docker:18.09
  290. secrets: [ docker_username, docker_password ]
  291. pull: true
  292. repo: gitea/gitea
  293. cache_from: gitea/gitea
  294. default_tags: true
  295. when:
  296. event: [ push, tag ]
  297. gpg-sign:
  298. image: plugins/gpgsign:1
  299. pull: true
  300. secrets: [ gpgsign_key, gpgsign_passphrase ]
  301. detach_sign: true
  302. files:
  303. - dist/release/*
  304. excludes:
  305. - dist/release/*.sha256
  306. when:
  307. event: [ push, tag ]
  308. tag-release:
  309. image: plugins/s3:1
  310. pull: true
  311. secrets: [ aws_access_key_id, aws_secret_access_key ]
  312. bucket: releases
  313. acl: public-read
  314. endpoint: https://storage.gitea.io
  315. path_style: true
  316. strip_prefix: dist/release/
  317. source: dist/release/*
  318. target: /gitea/${DRONE_TAG##v}
  319. when:
  320. event: [ tag ]
  321. release-branch-release:
  322. image: plugins/s3:1
  323. pull: true
  324. secrets: [ aws_access_key_id, aws_secret_access_key ]
  325. bucket: releases
  326. acl: public-read
  327. endpoint: https://storage.gitea.io
  328. path_style: true
  329. strip_prefix: dist/release/
  330. source: dist/release/*
  331. target: /gitea/${DRONE_BRANCH##release/v}
  332. when:
  333. event: [ push ]
  334. branch: [ release/* ]
  335. release:
  336. image: plugins/s3:1
  337. pull: true
  338. secrets: [ aws_access_key_id, aws_secret_access_key ]
  339. bucket: releases
  340. acl: public-read
  341. endpoint: https://storage.gitea.io
  342. path_style: true
  343. strip_prefix: dist/release/
  344. source: dist/release/*
  345. target: /gitea/master
  346. when:
  347. event: [ push ]
  348. branch: [ master ]
  349. github:
  350. image: plugins/github-release:1
  351. pull: true
  352. secrets: [ github_token ]
  353. files:
  354. - dist/release/*
  355. when:
  356. event: [ tag ]
  357. upload_translations:
  358. image: jonasfranz/crowdin
  359. pull: true
  360. secrets: [ crowdin_key ]
  361. project_identifier: gitea
  362. ignore_branch: true
  363. download: false
  364. files:
  365. locale_en-US.ini: options/locale/locale_en-US.ini
  366. when:
  367. event: [ push ]
  368. branch: [ master ]
  369. discord:
  370. image: appleboy/drone-discord:1.0.0
  371. pull: true
  372. secrets: [ discord_webhook_id, discord_webhook_token ]
  373. when:
  374. event: [ push, tag, pull_request ]
  375. status: [ changed, failure ]
  376. services:
  377. mysql:
  378. image: mysql:5.7
  379. environment:
  380. - MYSQL_DATABASE=test
  381. - MYSQL_ALLOW_EMPTY_PASSWORD=yes
  382. when:
  383. event: [ push, tag, pull_request ]
  384. mysql8:
  385. image: mysql:8.0
  386. environment:
  387. - MYSQL_DATABASE=test
  388. - MYSQL_ALLOW_EMPTY_PASSWORD=yes
  389. - MYSQL_DATABASE=testgitea
  390. when:
  391. event: [ push, tag, pull_request ]
  392. pgsql:
  393. image: postgres:9.5
  394. environment:
  395. - POSTGRES_DB=test
  396. when:
  397. event: [ push, tag, pull_request ]
  398. mssql:
  399. image: microsoft/mssql-server-linux:latest
  400. environment:
  401. - ACCEPT_EULA=Y
  402. - SA_PASSWORD=MwantsaSecurePassword1
  403. - MSSQL_PID=Standard
  404. when:
  405. event: [ push, tag, pull_request ]
  406. ldap:
  407. image: gitea/test-openldap:latest
  408. when:
  409. event: [ push, tag, pull_request ]