build_enterprise.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/bash
  2. #
  3. # This script is executed from within the container.
  4. #
  5. echo "building enterprise version"
  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. cd ..
  11. git clone -b master --single-branch git@github.com:grafana/grafana-enterprise.git --depth 10
  12. cd grafana-enterprise
  13. #git checkout 7fbae9c1be3467c4a39cf6ad85278a6896ceb49f
  14. ./build.sh
  15. cd ../grafana
  16. function exit_if_fail {
  17. command=$@
  18. echo "Executing '$command'"
  19. eval $command
  20. rc=$?
  21. if [ $rc -ne 0 ]; then
  22. echo "'$command' returned $rc."
  23. exit $rc
  24. fi
  25. }
  26. exit_if_fail go test ./pkg/extensions/...
  27. if [ "$CIRCLE_TAG" != "" ]; then
  28. echo "Building a release from tag $ls"
  29. go run build.go -buildNumber=${CIRCLE_BUILD_NUM} -enterprise=true -includeBuildNumber=false build
  30. else
  31. echo "Building incremental build for $CIRCLE_BRANCH"
  32. go run build.go -buildNumber=${CIRCLE_BUILD_NUM} -enterprise=true build
  33. fi
  34. yarn install --pure-lockfile --no-progress
  35. source /etc/profile.d/rvm.sh
  36. echo "current dir: $(pwd)"
  37. if [ "$CIRCLE_TAG" != "" ]; then
  38. echo "Packaging a release from tag $CIRCLE_TAG"
  39. go run build.go -buildNumber=${CIRCLE_BUILD_NUM} -enterprise=true -includeBuildNumber=false package latest
  40. else
  41. echo "Packaging incremental build for $CIRCLE_BRANCH"
  42. go run build.go -buildNumber=${CIRCLE_BUILD_NUM} -enterprise=true package latest
  43. fi