wercker.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. box: wercker/golang
  2. steps:
  3. - wercker/npm-install@0.9.3
  4. - wercker/step-grunt
  5. build:
  6. steps:
  7. script: |
  8. export RUBYVERSION=2.0.0-p594
  9. sudo apt-get update
  10. sudo apt-get install git zlib1g-dev libreadline-dev libqtwebkit-dev
  11. sudo apt-get remove ruby1.9.1
  12. cd $HOME
  13. mkdir rubyinstall
  14. cd rubyinstall
  15. wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-$RUBYVERSION.tar.gz
  16. tar xzvf ruby-$RUBYVERSION.tar.gz
  17. cd ruby-$RUBYVERSION
  18. ./configure --with-readline-dir=/usr/include/readline --with-openssl-dir=/usr/include/openssl
  19. make
  20. make test
  21. sudo make install
  22. cd $HOME
  23. rm -fr rubyinstall
  24. # Workspace
  25. - setup-go-workspace
  26. - script:
  27. name: build setup
  28. code: |
  29. go run build.go setup
  30. # Build the project
  31. - script:
  32. name: build backend
  33. code: |
  34. go run build.go build
  35. # Test the project
  36. - script:
  37. name: test backend
  38. code: |
  39. go run build.go test
  40. # frontend
  41. - npm-install
  42. - grunt:
  43. tasks: release
  44. - script:
  45. name: copy output
  46. code: |-
  47. rsync -rv "$WERCKER_SOURCE_DIR/dist/" "$WERCKER_OUTPUT_DIR"
  48. deploy:
  49. steps:
  50. - add-to-known_hosts:
  51. hostname: play.grafana.org
  52. - mktemp:
  53. envvar: PRIVATEKEY_PATH
  54. - create-file:
  55. name: write key
  56. filename: $PRIVATEKEY_PATH
  57. content: $GRAFANA_PLAY_PRIVATE
  58. overwrite: true
  59. hide-from-log: true
  60. - script:
  61. name: transfer application
  62. code: |
  63. pwd
  64. ls -la
  65. scp -i $PRIVATEKEY_PATH -o StrictHostKeyChecking=no -o UserKnownHostsFile=no * deploy@play.grafana.org:/home/deploy/
  66. - script:
  67. name: deploy application
  68. code: ssh -i $PRIVATEKEY_PATH -l deploy -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no play.grafana.org ./wercker_deploy.sh