build.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. #
  3. # This script is executed from within the container.
  4. #
  5. GOPATH=/go
  6. REPO_PATH=$GOPATH/src/github.com/grafana/grafana
  7. mkdir -p /go/src/github.com/grafana
  8. cd /go/src/github.com/grafana
  9. if [ "$CIRCLE_TAG" != "" ]; then
  10. echo "Builing from tag $CIRCLE_TAG"
  11. git clone https://github.com/grafana/grafana.git
  12. cd $REPO_PATH
  13. git checkout $CIRCLE_TAG
  14. else
  15. echo "Building from branch $CIRCLE_BRANCH"
  16. git clone --depth 1 https://github.com/grafana/grafana.git -b $CIRCLE_BRANCH
  17. cd $REPO_PATH
  18. fi
  19. echo "current dir: $(pwd)"
  20. if [ "$CIRCLE_TAG" != "" ]; then
  21. echo "Building incremental build for master"
  22. go run build.go build
  23. else
  24. echo "Building a release"
  25. go run build.go -includeBuildNumber=false build
  26. fi
  27. yarn install --pure-lockfile
  28. source /etc/profile.d/rvm.sh
  29. rvm use 2.1.9 --default
  30. gem install fpm -v 1.4
  31. echo "current dir: $(pwd)"
  32. if [ "$CIRCLE_TAG" != "" ]; then
  33. echo "Building incremental build for master"
  34. go run build.go package latest
  35. else
  36. echo "Building a release"
  37. go run build.go -includeBuildNumber=false package latest
  38. fi
  39. cp dist/* /tmp/dist/