.drone.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. workspace:
  2. base: /app
  3. path: .
  4. cache:
  5. - ".git"
  6. - "flow-ui/node_modules"
  7. - "go/deps"
  8. pipeline:
  9. restore-cache:
  10. image: drillster/drone-volume-cache
  11. restore: true
  12. mount:
  13. - ./flow-ui/node_modules
  14. - ./go/deps
  15. volumes:
  16. - /tmp/cache:/cache
  17. frontend:
  18. image: node:6
  19. commands:
  20. - cd flow-ui
  21. - yarn
  22. - yarn build
  23. backend:
  24. image: golang
  25. environment:
  26. - GOPATH=/app/go/deps:/app/go
  27. commands:
  28. - go get github.com/axw/gocov/gocov
  29. - go get github.com/gohxs/folder2go
  30. - go get -d ./go/src/...
  31. - go get -d -t ./go/src/...
  32. - go/deps/bin/gocov test -v -race ./go/src/... | go/deps/bin/gocov report
  33. - go/deps/bin/folder2go -nobackup ./flow-ui/dist flowuiassets go/src/github.com/hexasoftware/flow/flowserver/flowuiassets
  34. - CGO_ENABLED=0 go build -o DIST/demo1 demos/cmd/demo1
  35. rebuild-cache:
  36. image: drillster/drone-volume-cache
  37. rebuild: true
  38. mount:
  39. - ./flow-ui/node_modules
  40. - ./go/deps
  41. volumes:
  42. - /tmp/cache:/cache
  43. deploy:
  44. image: docker
  45. when:
  46. environment: staging
  47. event: deployment
  48. commands:
  49. - mkdir -p DIST
  50. - docker build --rm -t hexasoftware.com:5000/flow-proto -f ./docker/Dockerfile .
  51. - docker push hexasoftware.com:5000/flow-proto
  52. volumes:
  53. - /var/run/docker.sock:/var/run/docker.sock
  54. - /home/stdio/.docker/config.json:/root/.docker/config.json
  55. #check secrets
  56. notify:
  57. image: drillster/drone-email
  58. from: drone@hexasoftware.com
  59. skip_verify: true
  60. secrets: [email_password, email_recipients, email_host, email_username]
  61. when:
  62. status: [ failure, success ]