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"
|
2018-07-26 09:46:36 -05:00
|
|
|
OPT="-includeBuildNumber=false"
|
2017-01-31 03:10:25 -06:00
|
|
|
else
|
|
|
|
echo "Building incremental build for $CIRCLE_BRANCH"
|
2018-07-26 09:46:36 -05:00
|
|
|
OPT="-buildNumber=${CIRCLE_BUILD_NUM}"
|
2017-01-24 04:24:45 -06:00
|
|
|
fi
|
2017-01-23 08:09:18 -06:00
|
|
|
|
2018-07-26 09:46:36 -05:00
|
|
|
CC=${CCX64} go run build.go ${OPT} build
|
|
|
|
|
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
|
|
|
|
|
2018-07-26 09:46:36 -05:00
|
|
|
echo "Building frontend"
|
|
|
|
go run build.go ${OPT} build-frontend
|
|
|
|
|
|
|
|
echo "Packaging"
|
|
|
|
go run build.go -goos linux -pkg-arch amd64 ${OPT} package-only latest
|