wercker.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. box: wercker/golang
  2. steps:
  3. - wercker/npm-install@0.9.3
  4. - wercker/step-grunt
  5. build:
  6. steps:
  7. # Workspace
  8. - setup-go-workspace
  9. - script:
  10. name: install godep
  11. code: |
  12. go get -u github.com/tools/godep
  13. go install github.com/tools/godep
  14. # Build the project
  15. - script:
  16. name: build backend
  17. code: |
  18. go run build.go build
  19. # Test the project
  20. - script:
  21. name: test backend
  22. code: |
  23. go run build.go test
  24. # frontend
  25. - npm-install
  26. - grunt:
  27. tasks: release
  28. - script:
  29. name: copy output
  30. code: |-
  31. rsync -rv "$WERCKER_SOURCE_DIR/dist/" "$WERCKER_OUTPUT_DIR"
  32. deploy:
  33. steps:
  34. - add-to-known_hosts:
  35. hostname: play.grafana.org
  36. - mktemp:
  37. envvar: PRIVATEKEY_PATH
  38. - create-file:
  39. name: write key
  40. filename: $PRIVATEKEY_PATH
  41. content: $GRAFANA_PLAY_PRIVATE
  42. overwrite: true
  43. hide-from-log: true
  44. - script:
  45. name: transfer application
  46. code: |
  47. pwd
  48. ls -la
  49. scp -i $PRIVATEKEY_PATH -o StrictHostKeyChecking=no -o UserKnownHostsFile=no * deploy@play.grafana.org:/home/deploy/
  50. - script:
  51. name: deploy application
  52. code: ssh -i $PRIVATEKEY_PATH -l deploy -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no play.grafana.org ./wercker_deploy.sh