Enterprise crosscompilation (#13783)

* build: crosscompilation and release of enterprise.
This commit is contained in:
Leonard Gram
2018-10-22 14:33:19 +02:00
committed by GitHub
parent 16a2b207cc
commit 6c473d33f4
5 changed files with 112 additions and 67 deletions

View File

@@ -4,6 +4,10 @@
# This script is executed from within the container.
#
set -e
EXTRA_OPTS="$@"
CCARMV7=arm-linux-gnueabihf-gcc
CCARM64=aarch64-linux-gnu-gcc
CCOSX64=/tmp/osxcross/target/bin/o64-clang
@@ -18,15 +22,20 @@ echo "current dir: $(pwd)"
if [ "$CIRCLE_TAG" != "" ]; then
echo "Building releases from tag $CIRCLE_TAG"
OPT="-includeBuildNumber=false"
OPT="-includeBuildNumber=false ${EXTRA_OPTS}"
else
echo "Building incremental build for $CIRCLE_BRANCH"
OPT="-buildNumber=${CIRCLE_BUILD_NUM}"
OPT="-buildNumber=${CIRCLE_BUILD_NUM} ${EXTRA_OPTS}"
fi
echo "Build arguments: $OPT"
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
# MacOS build is broken atm. See Issue #13763
#go run build.go -goos darwin -cc ${CCOSX64} ${OPT} build
go run build.go -goos windows -cc ${CCWIN64} ${OPT} build
CC=${CCX64} go run build.go ${OPT} build

View File

@@ -4,6 +4,10 @@
# This script is executed from within the container.
#
set -e
EXTRA_OPTS="$@"
CCX64=/tmp/x86_64-centos6-linux-gnu/bin/x86_64-centos6-linux-gnu-gcc
GOPATH=/go
@@ -14,12 +18,14 @@ echo "current dir: $(pwd)"
if [ "$CIRCLE_TAG" != "" ]; then
echo "Building releases from tag $CIRCLE_TAG"
OPT="-includeBuildNumber=false"
OPT="-includeBuildNumber=false ${EXTRA_OPTS}"
else
echo "Building incremental build for $CIRCLE_BRANCH"
OPT="-buildNumber=${CIRCLE_BUILD_NUM}"
OPT="-buildNumber=${CIRCLE_BUILD_NUM} ${EXTRA_OPTS}"
fi
echo "Build arguments: $OPT"
CC=${CCX64} go run build.go ${OPT} build
yarn install --pure-lockfile --no-progress

View File

@@ -1,58 +0,0 @@
#!/bin/bash
#
# This script is executed from within the container.
#
echo "building enterprise version"
GOPATH=/go
REPO_PATH=$GOPATH/src/github.com/grafana/grafana
cd /go/src/github.com/grafana/grafana
echo "current dir: $(pwd)"
cd ..
git clone -b master --single-branch git@github.com:grafana/grafana-enterprise.git --depth 10
cd grafana-enterprise
#git checkout 7fbae9c1be3467c4a39cf6ad85278a6896ceb49f
./build.sh
cd ../grafana
function exit_if_fail {
command=$@
echo "Executing '$command'"
eval $command
rc=$?
if [ $rc -ne 0 ]; then
echo "'$command' returned $rc."
exit $rc
fi
}
exit_if_fail go test ./pkg/extensions/...
if [ "$CIRCLE_TAG" != "" ]; then
echo "Building a release from tag $ls"
go run build.go -buildNumber=${CIRCLE_BUILD_NUM} -enterprise=true -includeBuildNumber=false build
else
echo "Building incremental build for $CIRCLE_BRANCH"
go run build.go -buildNumber=${CIRCLE_BUILD_NUM} -enterprise=true build
fi
yarn install --pure-lockfile --no-progress
source /etc/profile.d/rvm.sh
echo "current dir: $(pwd)"
if [ "$CIRCLE_TAG" != "" ]; then
echo "Packaging a release from tag $CIRCLE_TAG"
go run build.go -buildNumber=${CIRCLE_BUILD_NUM} -enterprise=true -includeBuildNumber=false package latest
else
echo "Packaging incremental build for $CIRCLE_BRANCH"
go run build.go -buildNumber=${CIRCLE_BUILD_NUM} -enterprise=true package latest
fi

View File

@@ -0,0 +1,6 @@
#!/bin/bash
cd ..
git clone -b master --single-branch git@github.com:grafana/grafana-enterprise.git --depth 1
cd grafana-enterprise
./build.sh