2017-01-23 08:09:18 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#
|
|
|
|
# This script is executed from within the container.
|
|
|
|
#
|
|
|
|
|
2018-05-08 02:42:20 -05:00
|
|
|
CCX64=/tmp/x86_64-centos6-linux-gnu/bin/x86_64-centos6-linux-gnu-gcc
|
|
|
|
|
2017-01-23 08:09:18 -06:00
|
|
|
GOPATH=/go
|
|
|
|
REPO_PATH=$GOPATH/src/github.com/grafana/grafana
|
|
|
|
|
2017-02-24 02:22:57 -06:00
|
|
|
cd /go/src/github.com/grafana/grafana
|
2017-01-30 10:27:12 -06:00
|
|
|
echo "current dir: $(pwd)"
|
|
|
|
|
|
|
|
if [ "$CIRCLE_TAG" != "" ]; then
|
2018-05-08 02:42:20 -05:00
|
|
|
echo "Building releases from tag $CIRCLE_TAG"
|
|
|
|
CC=${CCX64} go run build.go -includeBuildNumber=false build
|
2017-01-31 03:10:25 -06:00
|
|
|
else
|
|
|
|
echo "Building incremental build for $CIRCLE_BRANCH"
|
2018-05-08 02:42:20 -05:00
|
|
|
CC=${CCX64} go run build.go -buildNumber=${CIRCLE_BUILD_NUM} build
|
2017-01-24 04:24:45 -06:00
|
|
|
fi
|
2017-01-23 08:09:18 -06:00
|
|
|
|
2017-02-13 08:26:10 -06:00
|
|
|
yarn install --pure-lockfile --no-progress
|
2017-01-23 08:09:18 -06:00
|
|
|
|
2017-01-30 10:27:12 -06:00
|
|
|
echo "current dir: $(pwd)"
|
|
|
|
|
2018-05-08 02:42:20 -05:00
|
|
|
if [ -d "dist" ]; then
|
|
|
|
rm -rf dist
|
|
|
|
fi
|
|
|
|
|
2017-01-30 10:27:12 -06:00
|
|
|
if [ "$CIRCLE_TAG" != "" ]; then
|
2018-05-08 02:42:20 -05:00
|
|
|
echo "Building frontend from tag $CIRCLE_TAG"
|
|
|
|
go run build.go -includeBuildNumber=false build-frontend
|
2017-01-31 03:10:25 -06:00
|
|
|
echo "Packaging a release from tag $CIRCLE_TAG"
|
2018-05-08 02:42:20 -05:00
|
|
|
go run build.go -goos linux -pkg-arch amd64 -includeBuildNumber=false package-only latest
|
2017-01-31 03:10:25 -06:00
|
|
|
else
|
2018-05-08 02:42:20 -05:00
|
|
|
echo "Building frontend for $CIRCLE_BRANCH"
|
|
|
|
go run build.go -buildNumber=${CIRCLE_BUILD_NUM} build-frontend
|
2017-01-31 03:10:25 -06:00
|
|
|
echo "Packaging incremental build for $CIRCLE_BRANCH"
|
2018-05-08 02:42:20 -05:00
|
|
|
go run build.go -goos linux -pkg-arch amd64 -buildNumber=${CIRCLE_BUILD_NUM} package-only latest
|
2017-01-30 10:27:12 -06:00
|
|
|
fi
|