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.

449 lines
9.9 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. download_translations:
  10. image: jonasfranz/crowdin
  11. pull: true
  12. secrets: [ crowdin_key ]
  13. project_identifier: gitea
  14. ignore_branch: true
  15. download: true
  16. export_dir: options/locale/
  17. when:
  18. event: [ push ]
  19. branch: [ master ]
  20. update-translations:
  21. image: alpine:3.7
  22. commands:
  23. - mv ./options/locale/locale_en-US.ini ./options/
  24. - sed -i -e 's/="/=/g' -e 's/"$$//g' ./options/locale/*.ini
  25. - sed -i -e 's/\\\\"/"/g' ./options/locale/*.ini
  26. - mv ./options/locale_en-US.ini ./options/locale/
  27. when:
  28. event: [ push ]
  29. branch: [ master ]
  30. git_push:
  31. image: appleboy/drone-git-push
  32. pull: true
  33. secrets: [ git_push_ssh_key ]
  34. remote: git@github.com:go-gitea/gitea.git
  35. force: false
  36. commit: true
  37. commit_message: "[skip ci] Updated translations via Crowdin"
  38. author_name: GiteaBot
  39. author_email: teabot@gitea.io
  40. when:
  41. event: [ push ]
  42. branch: [ master ]
  43. pre-build:
  44. image: webhippie/nodejs:latest
  45. pull: true
  46. commands:
  47. - npm install
  48. - make css
  49. - make js
  50. when:
  51. event: [ push, tag, pull_request ]
  52. build-without-gcc:
  53. image: golang:1.10 # this step is kept as the lowest version of golang that we support
  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.12
  61. pull: true
  62. environment:
  63. TAGS: bindata sqlite sqlite_unlock_notify
  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. 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.11
  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:17.12
  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:17.12
  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:17.12
  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 ]