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 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. workspace:
  2. base: /srv/app
  3. path: src/code.gitea.io/gitea
  4. pipeline:
  5. clone:
  6. image: plugins/git
  7. depth: 50
  8. tags: true
  9. build:
  10. image: webhippie/golang:edge
  11. pull: true
  12. environment:
  13. TAGS: bindata sqlite
  14. GOPATH: /srv/app
  15. commands:
  16. - apk -U add openssh-client
  17. - make clean
  18. - make generate
  19. - make vet
  20. - make lint
  21. - make misspell-check
  22. - make test-vendor
  23. - make build
  24. when:
  25. event: [ push, tag, pull_request ]
  26. test:
  27. image: webhippie/golang:edge
  28. pull: true
  29. environment:
  30. TAGS: bindata sqlite
  31. GOPATH: /srv/app
  32. commands:
  33. - apk -U add openssh-client
  34. - make test
  35. when:
  36. event: [ tag, pull_request ]
  37. test-coverage:
  38. image: webhippie/golang:edge
  39. pull: true
  40. environment:
  41. TAGS: bindata sqlite
  42. GOPATH: /srv/app
  43. commands:
  44. - apk -U add openssh-client
  45. - make test-coverage
  46. when:
  47. event: [ push ]
  48. branch: master
  49. test-sqlite:
  50. image: webhippie/golang:edge
  51. pull: true
  52. environment:
  53. TAGS: bindata
  54. GOPATH: /srv/app
  55. commands:
  56. - make test-sqlite
  57. when:
  58. event: [ push, tag, pull_request ]
  59. test-mysql:
  60. image: webhippie/golang:edge
  61. pull: true
  62. environment:
  63. TAGS: bindata
  64. GOPATH: /srv/app
  65. commands:
  66. - make test-mysql
  67. when:
  68. event: [ push, tag, pull_request ]
  69. test-pgsql:
  70. image: webhippie/golang:edge
  71. pull: true
  72. environment:
  73. TAGS: bindata
  74. GOPATH: /srv/app
  75. commands:
  76. - make test-pgsql
  77. when:
  78. event: [ push, tag, pull_request ]
  79. static:
  80. image: karalabe/xgo-latest:latest
  81. pull: true
  82. environment:
  83. TAGS: bindata sqlite
  84. GOPATH: /srv/app
  85. commands:
  86. - make release
  87. when:
  88. event: [ push, tag ]
  89. coverage:
  90. image: plugins/coverage
  91. server: https://coverage.gitea.io
  92. when:
  93. event: [ push ]
  94. branch: master
  95. docker:
  96. image: plugins/docker
  97. repo: gitea/gitea
  98. tags: [ '${DRONE_TAG##v}' ]
  99. when:
  100. event: [ tag ]
  101. branch: [ refs/tags/* ]
  102. docker:
  103. image: plugins/docker
  104. repo: gitea/gitea
  105. tags: [ '${DRONE_BRANCH##release/v}' ]
  106. when:
  107. event: [ push ]
  108. branch: [ release/* ]
  109. docker:
  110. image: plugins/docker
  111. repo: gitea/gitea
  112. tags: [ 'latest' ]
  113. when:
  114. event: [ push ]
  115. branch: [ master ]
  116. release:
  117. image: plugins/s3
  118. path_style: true
  119. strip_prefix: dist/release/
  120. source: dist/release/*
  121. target: /gitea/${DRONE_TAG##v}
  122. when:
  123. event: [ tag ]
  124. branch: [ refs/tags/* ]
  125. release:
  126. image: plugins/s3
  127. path_style: true
  128. strip_prefix: dist/release/
  129. source: dist/release/*
  130. target: /gitea/${DRONE_BRANCH##release/v}
  131. when:
  132. event: [ push ]
  133. branch: [ release/* ]
  134. release:
  135. image: plugins/s3
  136. path_style: true
  137. strip_prefix: dist/release/
  138. source: dist/release/*
  139. target: /gitea/master
  140. when:
  141. event: [ push ]
  142. branch: [ master ]
  143. github:
  144. image: plugins/github-release
  145. files:
  146. - dist/release/*
  147. when:
  148. event: [ tag ]
  149. branch: [ refs/tags/* ]
  150. discord:
  151. image: appleboy/drone-discord
  152. webhook_id: ${WEBHOOK_ID}
  153. webhook_token: ${WEBHOOK_TOKEN}
  154. when:
  155. event: [ push, tag, pull_request ]
  156. status: [ failure ]
  157. services:
  158. mysql:
  159. image: mysql:5.7
  160. environment:
  161. - MYSQL_DATABASE=test
  162. - MYSQL_ALLOW_EMPTY_PASSWORD=yes
  163. when:
  164. event: [ push, tag, pull_request ]
  165. pgsql:
  166. image: postgres:9.5
  167. environment:
  168. - POSTGRES_DB=test
  169. when:
  170. event: [ push, tag, pull_request ]