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. 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 stylesheets-check
  49. when:
  50. event: [ push, tag, pull_request ]
  51. build-without-gcc:
  52. image: golang:1.10 # this step is kept as the lowest version of golang that we support
  53. pull: true
  54. commands:
  55. - go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
  56. when:
  57. event: [ push, tag, pull_request ]
  58. build:
  59. image: golang:1.12
  60. pull: true
  61. environment:
  62. TAGS: bindata sqlite sqlite_unlock_notify
  63. commands:
  64. - make clean
  65. - make generate
  66. - make vet
  67. - make lint
  68. - make fmt-check
  69. - make swagger-check
  70. - make swagger-validate
  71. - make misspell-check
  72. - make test-vendor
  73. - make build
  74. when:
  75. event: [ push, tag, pull_request ]
  76. unit-test:
  77. image: golang:1.12
  78. pull: true
  79. group: test
  80. environment:
  81. TAGS: bindata sqlite sqlite_unlock_notify
  82. commands:
  83. - make unit-test-coverage
  84. when:
  85. event: [ push, pull_request ]
  86. branch: [ master ]
  87. release-test:
  88. image: golang:1.12
  89. pull: true
  90. group: test
  91. environment:
  92. TAGS: bindata sqlite sqlite_unlock_notify
  93. commands:
  94. - make test
  95. when:
  96. event: [ push, pull_request ]
  97. branch: [ release/* ]
  98. tag-test:
  99. image: golang:1.12
  100. pull: true
  101. group: test
  102. environment:
  103. TAGS: bindata
  104. commands:
  105. - make test
  106. when:
  107. event: [ tag ]
  108. test-sqlite:
  109. image: golang:1.12
  110. pull: true
  111. group: test
  112. environment:
  113. TAGS: bindata
  114. commands:
  115. - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  116. - apt-get install -y git-lfs
  117. - (sleep 1200 && (echo 'kill -ABRT $(pidof gitea) $(pidof integrations.sqlite.test)' | sh)) &
  118. - make test-sqlite-migration
  119. - 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. - (sleep 1200 && (echo 'kill -ABRT $(pidof gitea) $(pidof integrations.test)' | sh)) &
  148. - make test-mysql-migration
  149. - 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. - (sleep 1200 && (echo 'kill -ABRT $(pidof gitea) $(pidof integrations.test)' | sh)) &
  163. - make test-mysql8-migration
  164. - make test-mysql8
  165. when:
  166. event: [ push, tag, pull_request ]
  167. test-pgsql:
  168. image: golang:1.12
  169. pull: true
  170. group: test
  171. environment:
  172. TAGS: bindata
  173. TEST_LDAP: "1"
  174. commands:
  175. - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  176. - apt-get install -y git-lfs
  177. - (sleep 1200 && (echo 'kill -ABRT $(pidof gitea) $(pidof integrations.test)' | sh)) &
  178. - make test-pgsql-migration
  179. - 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 ]