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.

417 lines
9.1 KiB

  1. workspace:
  2. base: /go
  3. path: src/code.gitea.io/gitea
  4. clone:
  5. git:
  6. image: plugins/git:next
  7. depth: 50
  8. tags: true
  9. pipeline:
  10. download_translations:
  11. image: jonasfranz/crowdin
  12. pull: true
  13. secrets: [ crowdin_key ]
  14. project_identifier: gitea
  15. ignore_branch: true
  16. download: true
  17. export_dir: options/locale/
  18. when:
  19. event: [ push ]
  20. branch: [ master ]
  21. update-translations:
  22. image: alpine:3.7
  23. commands:
  24. - mv ./options/locale/locale_en-US.ini ./options/
  25. - sed -i -e 's/="/=/g' -e 's/"$$//g' ./options/locale/*.ini
  26. - sed -i -e 's/\\\\"/"/g' ./options/locale/*.ini
  27. - mv ./options/locale_en-US.ini ./options/locale/
  28. when:
  29. event: [ push ]
  30. branch: [ master ]
  31. git_push:
  32. image: appleboy/drone-git-push
  33. pull: true
  34. secrets: [ git_push_ssh_key ]
  35. remote: git@github.com:go-gitea/gitea.git
  36. force: false
  37. commit: true
  38. commit_message: "[skip ci] Updated translations via Crowdin"
  39. author_name: GiteaBot
  40. author_email: teabot@gitea.io
  41. when:
  42. event: [ push ]
  43. branch: [ master ]
  44. pre-build:
  45. image: webhippie/nodejs:latest
  46. pull: true
  47. commands:
  48. - npm install
  49. - make stylesheets-check
  50. when:
  51. event: [ push, tag, pull_request ]
  52. build-without-gcc:
  53. image: golang:1.9
  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.11
  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. test:
  78. image: golang:1.11
  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. test:
  89. image: golang:1.11
  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. test:
  100. image: golang:1.11
  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.11
  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. - (sleep 1200 && (echo 'kill -ABRT $(pidof gitea) $(pidof integrations.sqlite.test)' | sh)) &
  119. - make test-sqlite-migration
  120. - make test-sqlite
  121. when:
  122. event: [ push, tag, pull_request ]
  123. test-mysql:
  124. image: golang:1.11
  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. test-mysql:
  139. image: golang:1.11
  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. - (sleep 1200 && (echo 'kill -ABRT $(pidof gitea) $(pidof integrations.test)' | sh)) &
  149. - make test-mysql-migration
  150. - make test-mysql
  151. when:
  152. event: [ tag ]
  153. test-pgsql:
  154. image: golang:1.11
  155. pull: true
  156. group: test
  157. environment:
  158. TAGS: bindata
  159. TEST_LDAP: "1"
  160. commands:
  161. - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  162. - apt-get install -y git-lfs
  163. - (sleep 1200 && (echo 'kill -ABRT $(pidof gitea) $(pidof integrations.test)' | sh)) &
  164. - make test-pgsql-migration
  165. - make test-pgsql
  166. when:
  167. event: [ push, tag, pull_request ]
  168. test-mssql:
  169. image: golang:1.11
  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. - make test-mssql-migration
  179. - make test-mssql
  180. when:
  181. event: [ push, tag, pull_request ]
  182. bench-sqlite:
  183. image: golang:1.11
  184. pull: true
  185. group: bench
  186. commands:
  187. - make bench-sqlite
  188. when:
  189. event: [ tag ]
  190. bench-mysql:
  191. image: golang:1.11
  192. pull: true
  193. group: bench
  194. commands:
  195. - make bench-mysql
  196. when:
  197. event: [ tag ]
  198. bench-mssql:
  199. image: golang:1.11
  200. pull: true
  201. group: bench
  202. commands:
  203. - make bench-mssql
  204. when:
  205. event: [ tag ]
  206. bench-pgsql:
  207. image: golang:1.11
  208. pull: true
  209. group: bench
  210. commands:
  211. - make bench-pgsql
  212. when:
  213. event: [ tag ]
  214. generate-coverage:
  215. image: golang:1.11
  216. pull: true
  217. environment:
  218. TAGS: bindata
  219. commands:
  220. - make coverage
  221. when:
  222. event: [ push, pull_request ]
  223. branch: [ master ]
  224. coverage:
  225. image: robertstettner/drone-codecov
  226. secrets: [ codecov_token ]
  227. files:
  228. - coverage.all
  229. when:
  230. event: [ push, pull_request ]
  231. branch: [ master ]
  232. static:
  233. image: techknowlogick/xgo:latest
  234. pull: true
  235. environment:
  236. TAGS: bindata sqlite sqlite_unlock_notify
  237. commands:
  238. - export PATH=$PATH:$GOPATH/bin
  239. - make release
  240. when:
  241. event: [ push, tag ]
  242. build-docs:
  243. image: webhippie/hugo:latest
  244. pull: true
  245. commands:
  246. - cd docs
  247. - make trans-copy
  248. - make clean
  249. - make build
  250. publish-docs:
  251. image: lucap/drone-netlify:latest
  252. pull: true
  253. secrets: [ netlify_token ]
  254. site_id: d2260bae-7861-4c02-8646-8f6440b12672
  255. path: docs/public/
  256. when:
  257. event: [ push ]
  258. branch: [ master ]
  259. docker:
  260. image: plugins/docker:17.12
  261. pull: true
  262. secrets: [ docker_username, docker_password ]
  263. repo: gitea/gitea
  264. tags: [ '${DRONE_BRANCH##release/v}' ]
  265. when:
  266. event: [ push ]
  267. branch: [ release/* ]
  268. docker:
  269. image: plugins/docker:17.12
  270. secrets: [ docker_username, docker_password ]
  271. pull: true
  272. repo: gitea/gitea
  273. default_tags: true
  274. when:
  275. event: [ push, tag ]
  276. gpg-sign:
  277. image: plugins/gpgsign:1
  278. pull: true
  279. secrets: [ gpgsign_key, gpgsign_passphrase ]
  280. detach_sign: true
  281. files:
  282. - dist/release/*
  283. excludes:
  284. - dist/release/*.sha256
  285. when:
  286. event: [ push, tag ]
  287. release:
  288. image: plugins/s3:1
  289. pull: true
  290. secrets: [ aws_access_key_id, aws_secret_access_key ]
  291. bucket: releases
  292. acl: public-read
  293. endpoint: https://storage.gitea.io
  294. path_style: true
  295. strip_prefix: dist/release/
  296. source: dist/release/*
  297. target: /gitea/${DRONE_TAG##v}
  298. when:
  299. event: [ tag ]
  300. release:
  301. image: plugins/s3:1
  302. pull: true
  303. secrets: [ aws_access_key_id, aws_secret_access_key ]
  304. bucket: releases
  305. acl: public-read
  306. endpoint: https://storage.gitea.io
  307. path_style: true
  308. strip_prefix: dist/release/
  309. source: dist/release/*
  310. target: /gitea/${DRONE_BRANCH##release/v}
  311. when:
  312. event: [ push ]
  313. branch: [ release/* ]
  314. release:
  315. image: plugins/s3:1
  316. pull: true
  317. secrets: [ aws_access_key_id, aws_secret_access_key ]
  318. bucket: releases
  319. acl: public-read
  320. endpoint: https://storage.gitea.io
  321. path_style: true
  322. strip_prefix: dist/release/
  323. source: dist/release/*
  324. target: /gitea/master
  325. when:
  326. event: [ push ]
  327. branch: [ master ]
  328. github:
  329. image: plugins/github-release:1
  330. pull: true
  331. secrets: [ github_token ]
  332. files:
  333. - dist/release/*
  334. when:
  335. event: [ tag ]
  336. upload_translations:
  337. image: jonasfranz/crowdin
  338. pull: true
  339. secrets: [ crowdin_key ]
  340. project_identifier: gitea
  341. ignore_branch: true
  342. download: false
  343. files:
  344. locale_en-US.ini: options/locale/locale_en-US.ini
  345. when:
  346. event: [ push ]
  347. branch: [ master ]
  348. discord:
  349. image: appleboy/drone-discord:1.0.0
  350. pull: true
  351. secrets: [ discord_webhook_id, discord_webhook_token ]
  352. when:
  353. event: [ push, tag, pull_request ]
  354. status: [ changed, failure ]
  355. services:
  356. mysql:
  357. image: mysql:5.7
  358. environment:
  359. - MYSQL_DATABASE=test
  360. - MYSQL_ALLOW_EMPTY_PASSWORD=yes
  361. when:
  362. event: [ push, tag, pull_request ]
  363. pgsql:
  364. image: postgres:9.5
  365. environment:
  366. - POSTGRES_DB=test
  367. when:
  368. event: [ push, tag, pull_request ]
  369. mssql:
  370. image: microsoft/mssql-server-linux:latest
  371. environment:
  372. - ACCEPT_EULA=Y
  373. - SA_PASSWORD=MwantsaSecurePassword1
  374. - MSSQL_PID=Standard
  375. when:
  376. event: [ push, tag, pull_request ]
  377. ldap:
  378. image: gitea/test-openldap:latest
  379. when:
  380. event: [ push, tag, pull_request ]