.drone.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. ---
  2. kind: pipeline
  3. type: kubernetes
  4. name: default
  5. steps:
  6. - name: fetch-tags
  7. image: alpine/git
  8. commands:
  9. - git fetch --tags
  10. resources:
  11. requests:
  12. cpu: 250
  13. memory: 50MiB
  14. limits:
  15. cpu: 250
  16. memory: 100MiB
  17. - name: test
  18. image: golang:1.20.5
  19. volumes:
  20. - name: cache
  21. path: /go
  22. commands:
  23. - ./scripts/download-test-geoip
  24. - go get
  25. - go test -v ./...
  26. - go build ./...
  27. resources:
  28. requests:
  29. cpu: 1000
  30. memory: 128MiB
  31. limits:
  32. cpu: 2000
  33. memory: 2GiB
  34. - name: goreleaser
  35. image: golang:1.20.5
  36. resources:
  37. requests:
  38. cpu: 4000
  39. memory: 512MiB
  40. limits:
  41. cpu: 10000
  42. memory: 2048MiB
  43. volumes:
  44. - name: cache
  45. path: /go
  46. commands:
  47. - ./scripts/run-goreleaser
  48. - echo Done
  49. when:
  50. ref:
  51. - refs/heads/main
  52. - refs/heads/drone-test
  53. - refs/tags/**
  54. depends_on: [test]
  55. - name: upload
  56. image: plugins/s3
  57. resources:
  58. requests:
  59. cpu: 250
  60. memory: 64MiB
  61. limits:
  62. cpu: 250
  63. memory: 256MiB
  64. settings:
  65. access_key:
  66. from_secret: s3_access_key
  67. secret_key:
  68. from_secret: s3_secret_key
  69. bucket: geodns
  70. target: /builds/test/${DRONE_BUILD_NUMBER}
  71. source: dist/*
  72. strip_prefix: dist/
  73. endpoint: https://minio-ewr1.develooper.com/
  74. path_style: true
  75. depends_on: [goreleaser]
  76. - name: fury-publish
  77. image: golang:1.20.5
  78. resources:
  79. requests:
  80. cpu: 250
  81. memory: 64MiB
  82. limits:
  83. cpu: 250
  84. memory: 256MiB
  85. environment:
  86. FURY_TOKEN:
  87. from_secret: fury_test_token
  88. commands:
  89. - ./scripts/fury-publish ntppool-test
  90. when:
  91. ref:
  92. - refs/heads/main
  93. - refs/heads/drone-test
  94. - refs/tags/**
  95. depends_on: [goreleaser]
  96. volumes:
  97. - name: cache
  98. temp: {}
  99. trigger:
  100. event:
  101. - push
  102. - tag
  103. - pull_request
  104. ---
  105. kind: pipeline
  106. type: kubernetes
  107. name: publish-production
  108. steps:
  109. - name: download
  110. image: golang:1.20.5
  111. commands:
  112. - ./scripts/download-release test/${DRONE_BUILD_PARENT} dist/
  113. resources:
  114. requests:
  115. cpu: 250
  116. memory: 64MiB
  117. limits:
  118. cpu: 250
  119. memory: 256MiB
  120. - name: upload
  121. image: plugins/s3
  122. resources:
  123. requests:
  124. cpu: 250
  125. memory: 64MiB
  126. limits:
  127. cpu: 250
  128. memory: 256MiB
  129. settings:
  130. access_key:
  131. from_secret: s3_access_key
  132. secret_key:
  133. from_secret: s3_secret_key
  134. bucket: geodns
  135. target: /builds/release/${DRONE_BUILD_NUMBER}
  136. source: dist/*
  137. strip_prefix: dist/
  138. endpoint: https://minio-ewr1.develooper.com/
  139. path_style: true
  140. depends_on: ["download"]
  141. - name: fury-publish
  142. image: golang:1.20.5
  143. resources:
  144. requests:
  145. cpu: 250
  146. memory: 64MiB
  147. limits:
  148. cpu: 250
  149. memory: 256MiB
  150. environment:
  151. FURY_TOKEN:
  152. from_secret: fury_token
  153. commands:
  154. - ./scripts/fury-publish ntppool
  155. depends_on: ["download"]
  156. trigger:
  157. event:
  158. - promote
  159. target:
  160. - publish
  161. ---
  162. kind: signature
  163. hmac: 15fb83a349cd0141f9195dd089e87f44af8e9469945a31a720368ab5ef623f19
  164. ...