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.

.drone.yml 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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. generate-coverage:
  183. image: golang:1.11
  184. pull: true
  185. environment:
  186. TAGS: bindata
  187. commands:
  188. - make coverage
  189. when:
  190. event: [ push, pull_request ]
  191. branch: [ master ]
  192. coverage:
  193. image: robertstettner/drone-codecov
  194. secrets: [ codecov_token ]
  195. files:
  196. - coverage.all
  197. when:
  198. event: [ push, pull_request ]
  199. branch: [ master ]
  200. static:
  201. image: karalabe/xgo-latest:latest
  202. pull: true
  203. environment:
  204. TAGS: bindata sqlite sqlite_unlock_notify
  205. commands:
  206. - export PATH=$PATH:$GOPATH/bin
  207. - make release
  208. when:
  209. event: [ push, tag ]
  210. build-docs:
  211. image: webhippie/hugo:latest
  212. pull: true
  213. commands:
  214. - cd docs
  215. - make trans-copy
  216. - make clean
  217. - make build
  218. publish-docs:
  219. image: lucap/drone-netlify:latest
  220. pull: true
  221. secrets: [ netlify_token ]
  222. site_id: d2260bae-7861-4c02-8646-8f6440b12672
  223. path: docs/public/
  224. when:
  225. event: [ push ]
  226. branch: [ master ]
  227. docker:
  228. image: plugins/docker:17.12
  229. pull: true
  230. secrets: [ docker_username, docker_password ]
  231. repo: gitea/gitea
  232. tags: [ '${DRONE_BRANCH##release/v}' ]
  233. when:
  234. event: [ push ]
  235. branch: [ release/* ]
  236. docker:
  237. image: plugins/docker:17.12
  238. secrets: [ docker_username, docker_password ]
  239. pull: true
  240. repo: gitea/gitea
  241. default_tags: true
  242. when:
  243. event: [ push, tag ]
  244. gpg-sign:
  245. image: plugins/gpgsign:1
  246. pull: true
  247. secrets: [ gpgsign_key, gpgsign_passphrase ]
  248. detach_sign: true
  249. files:
  250. - dist/release/*
  251. excludes:
  252. - dist/release/*.sha256
  253. when:
  254. event: [ push, tag ]
  255. release:
  256. image: plugins/s3:1
  257. pull: true
  258. secrets: [ aws_access_key_id, aws_secret_access_key ]
  259. bucket: releases
  260. acl: public-read
  261. endpoint: https://storage.gitea.io
  262. path_style: true
  263. strip_prefix: dist/release/
  264. source: dist/release/*
  265. target: /gitea/${DRONE_TAG##v}
  266. when:
  267. event: [ tag ]
  268. release:
  269. image: plugins/s3:1
  270. pull: true
  271. secrets: [ aws_access_key_id, aws_secret_access_key ]
  272. bucket: releases
  273. acl: public-read
  274. endpoint: https://storage.gitea.io
  275. path_style: true
  276. strip_prefix: dist/release/
  277. source: dist/release/*
  278. target: /gitea/${DRONE_BRANCH##release/v}
  279. when:
  280. event: [ push ]
  281. branch: [ release/* ]
  282. release:
  283. image: plugins/s3:1
  284. pull: true
  285. secrets: [ aws_access_key_id, aws_secret_access_key ]
  286. bucket: releases
  287. acl: public-read
  288. endpoint: https://storage.gitea.io
  289. path_style: true
  290. strip_prefix: dist/release/
  291. source: dist/release/*
  292. target: /gitea/master
  293. when:
  294. event: [ push ]
  295. branch: [ master ]
  296. github:
  297. image: plugins/github-release:1
  298. pull: true
  299. secrets: [ github_token ]
  300. files:
  301. - dist/release/*
  302. when:
  303. event: [ tag ]
  304. upload_translations:
  305. image: jonasfranz/crowdin
  306. pull: true
  307. secrets: [ crowdin_key ]
  308. project_identifier: gitea
  309. ignore_branch: true
  310. download: false
  311. files:
  312. locale_en-US.ini: options/locale/locale_en-US.ini
  313. when:
  314. event: [ push ]
  315. branch: [ master ]
  316. discord:
  317. image: appleboy/drone-discord:1.0.0
  318. pull: true
  319. secrets: [ discord_webhook_id, discord_webhook_token ]
  320. when:
  321. event: [ push, tag, pull_request ]
  322. status: [ changed, failure ]
  323. services:
  324. mysql:
  325. image: mysql:5.7
  326. environment:
  327. - MYSQL_DATABASE=test
  328. - MYSQL_ALLOW_EMPTY_PASSWORD=yes
  329. when:
  330. event: [ push, tag, pull_request ]
  331. pgsql:
  332. image: postgres:9.5
  333. environment:
  334. - POSTGRES_DB=test
  335. when:
  336. event: [ push, tag, pull_request ]
  337. mssql:
  338. image: microsoft/mssql-server-linux:latest
  339. environment:
  340. - ACCEPT_EULA=Y
  341. - SA_PASSWORD=MwantsaSecurePassword1
  342. - MSSQL_PID=Standard
  343. when:
  344. event: [ push, tag, pull_request ]
  345. ldap:
  346. image: gitea/test-openldap:latest
  347. when:
  348. event: [ push, tag, pull_request ]