build.sh 868 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. #
  3. # This script is executed from within the container.
  4. #
  5. CCX64=/tmp/x86_64-centos6-linux-gnu/bin/x86_64-centos6-linux-gnu-gcc
  6. GOPATH=/go
  7. REPO_PATH=$GOPATH/src/github.com/grafana/grafana
  8. cd /go/src/github.com/grafana/grafana
  9. echo "current dir: $(pwd)"
  10. if [ "$CIRCLE_TAG" != "" ]; then
  11. echo "Building releases from tag $CIRCLE_TAG"
  12. OPT="-includeBuildNumber=false"
  13. else
  14. echo "Building incremental build for $CIRCLE_BRANCH"
  15. OPT="-buildNumber=${CIRCLE_BUILD_NUM}"
  16. fi
  17. CC=${CCX64} go run build.go ${OPT} build
  18. yarn install --pure-lockfile --no-progress
  19. echo "current dir: $(pwd)"
  20. if [ -d "dist" ]; then
  21. rm -rf dist
  22. fi
  23. echo "Building frontend"
  24. go run build.go ${OPT} build-frontend
  25. # Load ruby, needed for packing with fpm
  26. source /etc/profile.d/rvm.sh
  27. echo "Packaging"
  28. go run build.go -goos linux -pkg-arch amd64 ${OPT} package-only latest