.drone.yml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  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.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. - (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.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. - (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-mysql8:
  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-mysql8-migration
  165. - 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. - (sleep 1200 && (echo 'kill -ABRT $(pidof gitea) $(pidof integrations.test)' | sh)) &
  179. - make test-pgsql-migration
  180. - make test-pgsql
  181. when:
  182. event: [ push, tag, pull_request ]
  183. test-mssql:
  184. image: golang:1.12
  185. pull: true
  186. group: test
  187. environment:
  188. TAGS: bindata
  189. TEST_LDAP: "1"
  190. commands:
  191. - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  192. - apt-get install -y git-lfs
  193. - make test-mssql-migration
  194. - make test-mssql
  195. when:
  196. event: [ push, tag, pull_request ]
  197. # bench-sqlite:
  198. # image: golang:1.12
  199. # pull: true
  200. # group: bench
  201. # commands:
  202. # - make bench-sqlite
  203. # when:
  204. # event: [ tag ]
  205. # bench-mysql:
  206. # image: golang:1.12
  207. # pull: true
  208. # group: bench
  209. # commands:
  210. # - make bench-mysql
  211. # when:
  212. # event: [ tag ]
  213. # bench-mssql:
  214. # image: golang:1.12
  215. # pull: true
  216. # group: bench
  217. # commands:
  218. # - make bench-mssql
  219. # when:
  220. # event: [ tag ]
  221. # bench-pgsql:
  222. # image: golang:1.12
  223. # pull: true
  224. # group: bench
  225. # commands:
  226. # - make bench-pgsql
  227. # when:
  228. # event: [ tag ]
  229. generate-coverage:
  230. image: golang:1.12
  231. pull: true
  232. environment:
  233. TAGS: bindata
  234. commands:
  235. - make coverage
  236. when:
  237. event: [ push, pull_request ]
  238. branch: [ master ]
  239. coverage:
  240. image: robertstettner/drone-codecov
  241. secrets: [ codecov_token ]
  242. files:
  243. - coverage.all
  244. when:
  245. event: [ push, pull_request ]
  246. branch: [ master ]
  247. static:
  248. image: techknowlogick/xgo:latest
  249. pull: true
  250. environment:
  251. TAGS: bindata sqlite sqlite_unlock_notify
  252. commands:
  253. - export PATH=$PATH:$GOPATH/bin
  254. - make release
  255. when:
  256. event: [ push, tag ]
  257. build-docs:
  258. image: webhippie/hugo:latest
  259. pull: true
  260. commands:
  261. - cd docs
  262. - make trans-copy
  263. - make clean
  264. - make build
  265. publish-docs:
  266. image: lucap/drone-netlify:latest
  267. pull: true
  268. secrets: [ netlify_token ]
  269. site_id: d2260bae-7861-4c02-8646-8f6440b12672
  270. path: docs/public/
  271. when:
  272. event: [ push ]
  273. branch: [ master ]
  274. docker-dryrun:
  275. image: plugins/docker:17.12
  276. pull: true
  277. repo: gitea/gitea
  278. cache_from: gitea/gitea
  279. dry_run: true
  280. when:
  281. event: [ pull_request ]
  282. release-docker:
  283. image: plugins/docker:17.12
  284. pull: true
  285. secrets: [ docker_username, docker_password ]
  286. repo: gitea/gitea
  287. tags: [ '${DRONE_BRANCH##release/v}' ]
  288. cache_from: gitea/gitea
  289. when:
  290. event: [ push ]
  291. branch: [ release/* ]
  292. docker:
  293. image: plugins/docker:17.12
  294. secrets: [ docker_username, docker_password ]
  295. pull: true
  296. repo: gitea/gitea
  297. cache_from: gitea/gitea
  298. default_tags: true
  299. when:
  300. event: [ push, tag ]
  301. gpg-sign:
  302. image: plugins/gpgsign:1
  303. pull: true
  304. secrets: [ gpgsign_key, gpgsign_passphrase ]
  305. detach_sign: true
  306. files:
  307. - dist/release/*
  308. excludes:
  309. - dist/release/*.sha256
  310. when:
  311. event: [ push, tag ]
  312. tag-release:
  313. image: plugins/s3:1
  314. pull: true
  315. secrets: [ aws_access_key_id, aws_secret_access_key ]
  316. bucket: releases
  317. acl: public-read
  318. endpoint: https://storage.gitea.io
  319. path_style: true
  320. strip_prefix: dist/release/
  321. source: dist/release/*
  322. target: /gitea/${DRONE_TAG##v}
  323. when:
  324. event: [ tag ]
  325. release-branch-release:
  326. image: plugins/s3:1
  327. pull: true
  328. secrets: [ aws_access_key_id, aws_secret_access_key ]
  329. bucket: releases
  330. acl: public-read
  331. endpoint: https://storage.gitea.io
  332. path_style: true
  333. strip_prefix: dist/release/
  334. source: dist/release/*
  335. target: /gitea/${DRONE_BRANCH##release/v}
  336. when:
  337. event: [ push ]
  338. branch: [ release/* ]
  339. release:
  340. image: plugins/s3:1
  341. pull: true
  342. secrets: [ aws_access_key_id, aws_secret_access_key ]
  343. bucket: releases
  344. acl: public-read
  345. endpoint: https://storage.gitea.io
  346. path_style: true
  347. strip_prefix: dist/release/
  348. source: dist/release/*
  349. target: /gitea/master
  350. when:
  351. event: [ push ]
  352. branch: [ master ]
  353. github:
  354. image: plugins/github-release:1
  355. pull: true
  356. secrets: [ github_token ]
  357. files:
  358. - dist/release/*
  359. when:
  360. event: [ tag ]
  361. upload_translations:
  362. image: jonasfranz/crowdin
  363. pull: true
  364. secrets: [ crowdin_key ]
  365. project_identifier: gitea
  366. ignore_branch: true
  367. download: false
  368. files:
  369. locale_en-US.ini: options/locale/locale_en-US.ini
  370. when:
  371. event: [ push ]
  372. branch: [ master ]
  373. discord:
  374. image: appleboy/drone-discord:1.0.0
  375. pull: true
  376. secrets: [ discord_webhook_id, discord_webhook_token ]
  377. when:
  378. event: [ push, tag, pull_request ]
  379. status: [ changed, failure ]
  380. services:
  381. mysql:
  382. image: mysql:5.7
  383. environment:
  384. - MYSQL_DATABASE=test
  385. - MYSQL_ALLOW_EMPTY_PASSWORD=yes
  386. when:
  387. event: [ push, tag, pull_request ]
  388. mysql8:
  389. image: mysql:8.0
  390. environment:
  391. - MYSQL_DATABASE=test
  392. - MYSQL_ALLOW_EMPTY_PASSWORD=yes
  393. - MYSQL_DATABASE=testgitea
  394. when:
  395. event: [ push, tag, pull_request ]
  396. pgsql:
  397. image: postgres:9.5
  398. environment:
  399. - POSTGRES_DB=test
  400. when:
  401. event: [ push, tag, pull_request ]
  402. mssql:
  403. image: microsoft/mssql-server-linux:latest
  404. environment:
  405. - ACCEPT_EULA=Y
  406. - SA_PASSWORD=MwantsaSecurePassword1
  407. - MSSQL_PID=Standard
  408. when:
  409. event: [ push, tag, pull_request ]
  410. ldap:
  411. image: gitea/test-openldap:latest
  412. when:
  413. event: [ push, tag, pull_request ]