build.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. CC=${CCX64} go run build.go -includeBuildNumber=false build
  13. else
  14. echo "Building incremental build for $CIRCLE_BRANCH"
  15. CC=${CCX64} go run build.go -buildNumber=${CIRCLE_BUILD_NUM} build
  16. fi
  17. yarn install --pure-lockfile --no-progress
  18. echo "current dir: $(pwd)"
  19. if [ -d "dist" ]; then
  20. rm -rf dist
  21. fi
  22. if [ "$CIRCLE_TAG" != "" ]; then
  23. echo "Building frontend from tag $CIRCLE_TAG"
  24. go run build.go -includeBuildNumber=false build-frontend
  25. echo "Packaging a release from tag $CIRCLE_TAG"
  26. go run build.go -goos linux -pkg-arch amd64 -includeBuildNumber=false package-only latest
  27. else
  28. echo "Building frontend for $CIRCLE_BRANCH"
  29. go run build.go -buildNumber=${CIRCLE_BUILD_NUM} build-frontend
  30. echo "Packaging incremental build for $CIRCLE_BRANCH"
  31. go run build.go -goos linux -pkg-arch amd64 -buildNumber=${CIRCLE_BUILD_NUM} package-only latest
  32. fi