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.

194 lines
3.8 KiB

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