|
@@ -6,6 +6,7 @@
|
|
|
|
|
|
|
|
set -e
|
|
set -e
|
|
|
|
|
|
|
|
|
|
+# shellcheck disable=SC2124
|
|
|
EXTRA_OPTS="$@"
|
|
EXTRA_OPTS="$@"
|
|
|
|
|
|
|
|
CCARMV6=/opt/rpi-tools/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
|
|
CCARMV6=/opt/rpi-tools/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
|
|
@@ -15,9 +16,6 @@ CCOSX64=/tmp/osxcross/target/bin/o64-clang
|
|
|
CCWIN64=x86_64-w64-mingw32-gcc
|
|
CCWIN64=x86_64-w64-mingw32-gcc
|
|
|
CCX64=/tmp/x86_64-centos6-linux-gnu/bin/x86_64-centos6-linux-gnu-gcc
|
|
CCX64=/tmp/x86_64-centos6-linux-gnu/bin/x86_64-centos6-linux-gnu-gcc
|
|
|
|
|
|
|
|
-GOPATH=/go
|
|
|
|
|
-REPO_PATH=$GOPATH/src/github.com/grafana/grafana
|
|
|
|
|
-
|
|
|
|
|
cd /go/src/github.com/grafana/grafana
|
|
cd /go/src/github.com/grafana/grafana
|
|
|
echo "current dir: $(pwd)"
|
|
echo "current dir: $(pwd)"
|
|
|
|
|
|
|
@@ -34,16 +32,16 @@ echo "current dir: $(pwd)"
|
|
|
|
|
|
|
|
# build only amd64 for enterprise
|
|
# build only amd64 for enterprise
|
|
|
if echo "$EXTRA_OPTS" | grep -vq enterprise ; then
|
|
if echo "$EXTRA_OPTS" | grep -vq enterprise ; then
|
|
|
- go run build.go -goarch armv6 -cc ${CCARMV6} ${OPT} build
|
|
|
|
|
- go run build.go -goarch armv7 -cc ${CCARMV7} ${OPT} build
|
|
|
|
|
- go run build.go -goarch arm64 -cc ${CCARM64} ${OPT} build
|
|
|
|
|
- go run build.go -goos darwin -cc ${CCOSX64} ${OPT} build
|
|
|
|
|
|
|
+ go run build.go -goarch armv6 -cc "${CCARMV6}" "${OPT}" build
|
|
|
|
|
+ go run build.go -goarch armv7 -cc "${CCARMV7}" "${OPT}" build
|
|
|
|
|
+ go run build.go -goarch arm64 -cc "${CCARM64}" "${OPT}" build
|
|
|
|
|
+ go run build.go -goos darwin -cc "${CCOSX64}" "${OPT}" build
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
-go run build.go -goos windows -cc ${CCWIN64} ${OPT} build
|
|
|
|
|
|
|
+go run build.go -goos windows -cc "${CCWIN64}" "${OPT}" build
|
|
|
|
|
|
|
|
# Do not remove CC from the linux build, its there for compatibility with Centos6
|
|
# Do not remove CC from the linux build, its there for compatibility with Centos6
|
|
|
-CC=${CCX64} go run build.go ${OPT} build
|
|
|
|
|
|
|
+CC=${CCX64} go run build.go "${OPT}" build
|
|
|
|
|
|
|
|
yarn install --pure-lockfile --no-progress
|
|
yarn install --pure-lockfile --no-progress
|
|
|
|
|
|
|
@@ -53,35 +51,36 @@ else
|
|
|
echo "Building frontend and packaging incremental build for $CIRCLE_BRANCH"
|
|
echo "Building frontend and packaging incremental build for $CIRCLE_BRANCH"
|
|
|
fi
|
|
fi
|
|
|
echo "Building frontend"
|
|
echo "Building frontend"
|
|
|
-go run build.go ${OPT} build-frontend
|
|
|
|
|
|
|
+go run build.go "${OPT}" build-frontend
|
|
|
|
|
|
|
|
if [ -d "dist" ]; then
|
|
if [ -d "dist" ]; then
|
|
|
rm -rf dist
|
|
rm -rf dist
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
mkdir dist
|
|
mkdir dist
|
|
|
-go run build.go -gen-version ${OPT} > dist/grafana.version
|
|
|
|
|
|
|
+go run build.go -gen-version "${OPT}" > dist/grafana.version
|
|
|
|
|
|
|
|
# Load ruby, needed for packing with fpm
|
|
# Load ruby, needed for packing with fpm
|
|
|
|
|
+# shellcheck disable=SC1091
|
|
|
source /etc/profile.d/rvm.sh
|
|
source /etc/profile.d/rvm.sh
|
|
|
|
|
|
|
|
echo "Packaging"
|
|
echo "Packaging"
|
|
|
-go run build.go -goos linux -pkg-arch amd64 ${OPT} package-only
|
|
|
|
|
|
|
+go run build.go -goos linux -pkg-arch amd64 "${OPT}" package-only
|
|
|
#removing amd64 phantomjs bin for armv7/arm64 packages
|
|
#removing amd64 phantomjs bin for armv7/arm64 packages
|
|
|
rm tools/phantomjs/phantomjs
|
|
rm tools/phantomjs/phantomjs
|
|
|
|
|
|
|
|
# build only amd64 for enterprise
|
|
# build only amd64 for enterprise
|
|
|
if echo "$EXTRA_OPTS" | grep -vq enterprise ; then
|
|
if echo "$EXTRA_OPTS" | grep -vq enterprise ; then
|
|
|
- go run build.go -goos linux -pkg-arch armv6 ${OPT} -skipRpm package-only
|
|
|
|
|
- go run build.go -goos linux -pkg-arch armv7 ${OPT} package-only
|
|
|
|
|
- go run build.go -goos linux -pkg-arch arm64 ${OPT} package-only
|
|
|
|
|
|
|
+ go run build.go -goos linux -pkg-arch armv6 "${OPT}" -skipRpm package-only
|
|
|
|
|
+ go run build.go -goos linux -pkg-arch armv7 "${OPT}" package-only
|
|
|
|
|
+ go run build.go -goos linux -pkg-arch arm64 "${OPT}" package-only
|
|
|
|
|
|
|
|
if [ -d '/tmp/phantomjs/darwin' ]; then
|
|
if [ -d '/tmp/phantomjs/darwin' ]; then
|
|
|
cp /tmp/phantomjs/darwin/phantomjs tools/phantomjs/phantomjs
|
|
cp /tmp/phantomjs/darwin/phantomjs tools/phantomjs/phantomjs
|
|
|
else
|
|
else
|
|
|
echo 'PhantomJS binaries for darwin missing!'
|
|
echo 'PhantomJS binaries for darwin missing!'
|
|
|
fi
|
|
fi
|
|
|
- go run build.go -goos darwin -pkg-arch amd64 ${OPT} package-only
|
|
|
|
|
|
|
+ go run build.go -goos darwin -pkg-arch amd64 "${OPT}" package-only
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
if [ -d '/tmp/phantomjs/windows' ]; then
|
|
if [ -d '/tmp/phantomjs/windows' ]; then
|
|
@@ -90,6 +89,6 @@ if [ -d '/tmp/phantomjs/windows' ]; then
|
|
|
else
|
|
else
|
|
|
echo 'PhantomJS binaries for Windows missing!'
|
|
echo 'PhantomJS binaries for Windows missing!'
|
|
|
fi
|
|
fi
|
|
|
-go run build.go -goos windows -pkg-arch amd64 ${OPT} package-only
|
|
|
|
|
|
|
+go run build.go -goos windows -pkg-arch amd64 "${OPT}" package-only
|
|
|
|
|
|
|
|
go run build.go latest
|
|
go run build.go latest
|