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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. workspace:
  2. base: /srv/app
  3. path: src/git.kolaente.de/konrad/Library
  4. clone:
  5. git:
  6. image: plugins/git
  7. depth: 50
  8. tags: true
  9. pipeline:
  10. build-backend:
  11. image: webhippie/golang:edge
  12. pull: true
  13. group: build
  14. environment:
  15. TAGS: bindata sqlite
  16. GOPATH: /srv/app
  17. commands:
  18. - make clean
  19. - make lint
  20. - make fmt-check
  21. - make build
  22. when:
  23. event: [ push, tag, pull_request ]
  24. build-frontend:
  25. image: node:latest
  26. pull: true
  27. group: build
  28. commands:
  29. - cd frontend/
  30. - rm siteconfig.json
  31. - "echo '{\"API_URL\": \"/api/v1/\"}' > siteconfig.json"
  32. - npm install
  33. - npm run build
  34. when:
  35. event: [ push, tag, pull_request ]
  36. test-backend:
  37. image: webhippie/golang:edge
  38. pull: true
  39. environment:
  40. GOPATH: /srv/app
  41. commands:
  42. - make test
  43. when:
  44. event: [ push, tag, pull_request ]
  45. # Build a release when tagging
  46. before-static-build:
  47. image: karalabe/xgo-latest:latest
  48. pull: true
  49. environment:
  50. TAGS: bindata sqlite
  51. GOPATH: /srv/app
  52. commands:
  53. - make release-dirs
  54. when:
  55. event: [tag, push]
  56. static-build-windows:
  57. image: karalabe/xgo-latest:latest
  58. pull: true
  59. group: build-static
  60. environment:
  61. TAGS: bindata sqlite
  62. GOPATH: /srv/app
  63. commands:
  64. - make release-windows
  65. when:
  66. event: [tag, push]
  67. static-build-linux:
  68. image: karalabe/xgo-latest:latest
  69. pull: true
  70. group: build-static
  71. environment:
  72. TAGS: bindata sqlite
  73. GOPATH: /srv/app
  74. commands:
  75. - make release-linux
  76. when:
  77. event: [tag, push]
  78. static-build-darwin:
  79. image: karalabe/xgo-latest:latest
  80. pull: true
  81. group: build-static
  82. environment:
  83. TAGS: bindata sqlite
  84. GOPATH: /srv/app
  85. commands:
  86. - make release-darwin
  87. when:
  88. event: [tag, push]
  89. # static-build-frontend:
  90. # image: webhippie/nodejs:current
  91. # pull: true
  92. # group: build-static
  93. # commands:
  94. # - make release-frontend
  95. # when:
  96. # event: [push, tag ]
  97. after-build-static:
  98. image: karalabe/xgo-latest:latest
  99. pull: true
  100. environment:
  101. TAGS: bindata sqlite
  102. GOPATH: /srv/app
  103. commands:
  104. - make release-copy
  105. - make release-check
  106. - make release-os-package
  107. - make release-zip
  108. when:
  109. event: [tag, push]
  110. # Push the releases to our pseudo-s3-bucket
  111. release:
  112. image: plugins/s3:1
  113. pull: true
  114. secrets: [ aws_access_key_id, aws_secret_access_key ]
  115. bucket: library-release
  116. endpoint: https://storage.kolaente.de
  117. path_style: true
  118. strip_prefix: dist/zip/
  119. source: dist/zip/*
  120. target: /${DRONE_TAG##v}
  121. when:
  122. event: [ tag ]
  123. release:
  124. image: plugins/s3:1
  125. pull: true
  126. secrets: [ aws_access_key_id, aws_secret_access_key ]
  127. bucket: library-release
  128. endpoint: https://storage.kolaente.de
  129. path_style: true
  130. strip_prefix: dist/zip/
  131. source: dist/zip/*
  132. target: /master
  133. when:
  134. event: [ push ]
  135. branch: [ master ]
  136. # release-minio:
  137. # image: minio/mc
  138. # pull: true
  139. # secrets: [ aws_access_key_id, aws_secret_access_key ]
  140. # commands:
  141. # - mc config host add minio https://storage.kolaente.de $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY S3v4 --insecure
  142. # - mc cp dist/release/* library-release/master/ -r --insecure
  143. # when:
  144. # event: [ push ]
  145. # branch: [ master ]
  146. # release-minio:
  147. # image: minio/mc
  148. # pull: true
  149. # secrets: [ aws_access_key_id, aws_secret_access_key ]
  150. # commands:
  151. # - mc config host add minio https://storage.kolaente.de $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY S3v4 --insecure
  152. # - mc cp dist/release/* library-release/${DRONE_TAG##v}/ -r --insecure
  153. # when:
  154. # event: [ tag ]