build.sh 714 B

123456789101112131415161718192021222324252627282930313233343536
  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 [ -n "${CIRCLE_TAG}" ]; then
  10. echo "Building from tag ${CIRCLE_TAG}"
  11. git clone --depth 1 https://github.com/grafana/grafana.git -b $CIRCLE_BRANCH
  12. cd $REPO_PATH
  13. else
  14. echo "Building from branch ${CIRCLE_BRANCH}"
  15. git clone --depth 1 https://github.com/grafana/grafana.git
  16. cd $REPO_PATH
  17. git checkout $CIRCLE_TAG
  18. fi
  19. go run build.go build
  20. yarn install --pure-lockfile
  21. source /etc/profile.d/rvm.sh
  22. rvm use 2.1.9 --default
  23. gem install fpm -v 1.4
  24. go run build.go package latest
  25. cp dist/* /tmp/dist/