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.

452 lines
10 KiB

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