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

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