build: builds armv6 with rpi1 compat gcc.

This commit is contained in:
Leonard Gram
2019-03-22 16:12:42 +01:00
parent 35965e0efd
commit 6e802dc94d
5 changed files with 78 additions and 29 deletions

View File

@ -8,6 +8,7 @@ set -e
EXTRA_OPTS="$@"
CCARMV6=/opt/rpi-tools/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
CCARMV7=arm-linux-gnueabihf-gcc
CCARM64=aarch64-linux-gnu-gcc
CCOSX64=/tmp/osxcross/target/bin/o64-clang
@ -29,10 +30,18 @@ else
fi
echo "Build arguments: $OPT"
echo "current dir: $(pwd)"
if [ -d "dist" ]; then
rm -rf dist
fi
mkdir dist
go run build.go -gen-version ${OPT} > dist/grafana.version
# build only amd64 for enterprise
if echo "$EXTRA_OPTS" | grep -vq enterprise ; then
go run build.go -goarch armv6 -cc ${CCARMV7} ${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
@ -45,12 +54,6 @@ CC=${CCX64} go run build.go ${OPT} build
yarn install --pure-lockfile --no-progress
echo "current dir: $(pwd)"
if [ -d "dist" ]; then
rm -rf dist
fi
if [ "$CIRCLE_TAG" != "" ]; then
echo "Building frontend and packaging from tag $CIRCLE_TAG"
else

View File

@ -8,6 +8,7 @@ set -e
EXTRA_OPTS="$@"
CCARMV6=/opt/rpi-tools/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
CCARMV7=arm-linux-gnueabihf-gcc
CCARM64=aarch64-linux-gnu-gcc
CCX64=/tmp/x86_64-centos6-linux-gnu/bin/x86_64-centos6-linux-gnu-gcc
@ -26,9 +27,18 @@ else
OPT="-buildId=${CIRCLE_WORKFLOW_ID} ${EXTRA_OPTS}"
fi
echo "Build arguments: $OPT"
go run build.go -goarch armv6 -cc ${CCARMV7} ${OPT} build
echo "Build arguments: $OPT"
echo "current dir: $(pwd)"
if [ -d "dist" ]; then
rm -rf dist
fi
mkdir dist
go run build.go -gen-version ${OPT} > dist/grafana.version
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
@ -36,12 +46,6 @@ CC=${CCX64} go run build.go ${OPT} build
yarn install --pure-lockfile --no-progress
echo "current dir: $(pwd)"
if [ -d "dist" ]; then
rm -rf dist
fi
echo "Building frontend"
go run build.go ${OPT} build-frontend

View File

@ -103,7 +103,8 @@ RUN apt-get update && \
| tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install --no-install-recommends yarn && \
curl -L https://storage.googleapis.com/golang/go${GOVERSION}.linux-amd64.tar.gz \
| tar -xz -C /usr/local
| tar -xz -C /usr/local && \
git clone https://github.com/raspberrypi/tools.git /opt/rpi-tools --depth=1
RUN apt-get install -y \
gcc libc-dev make && \
@ -111,4 +112,4 @@ RUN apt-get install -y \
curl -sSL https://get.rvm.io | bash -s stable && \
/bin/bash -l -c "rvm requirements && rvm install 2.2 && gem install -N fpm"
ADD ./bootstrap.sh /tmp/bootstrap.sh
ADD ./bootstrap.sh /tmp/bootstrap.sh