From d71f1bf4bc4d5868f993d36f508c631ca1f44714 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Thu, 17 Jan 2019 11:00:34 +0100 Subject: [PATCH] build: only build amd64 for enterprise. --- scripts/build/build-all.sh | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/scripts/build/build-all.sh b/scripts/build/build-all.sh index 980ef5cc4c2..654abaf1174 100755 --- a/scripts/build/build-all.sh +++ b/scripts/build/build-all.sh @@ -30,10 +30,13 @@ 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 +# might want to check for enterprise here and only build what we need +if echo "$EXTRA_OPTS" | grep -vq enterprise ; then + 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 go run build.go -goos windows -cc ${CCWIN64} ${OPT} build # Do not remove CC from the linux build, its there for compatibility with Centos6 @@ -62,22 +65,25 @@ echo "Packaging" go run build.go -goos linux -pkg-arch amd64 ${OPT} package-only #removing amd64 phantomjs bin for armv7/arm64 packages rm tools/phantomjs/phantomjs -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 - cp /tmp/phantomjs/darwin/phantomjs tools/phantomjs/phantomjs -else - echo 'PhantomJS binaries for darwin missing!' +if echo "$EXTRA_OPTS" | grep -vq enterprise ; then + 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 + cp /tmp/phantomjs/darwin/phantomjs tools/phantomjs/phantomjs + else + echo 'PhantomJS binaries for darwin missing!' + fi + go run build.go -goos darwin -pkg-arch amd64 ${OPT} package-only fi -go run build.go -goos darwin -pkg-arch amd64 ${OPT} package-only if [ -d '/tmp/phantomjs/windows' ]; then cp /tmp/phantomjs/windows/phantomjs.exe tools/phantomjs/phantomjs.exe - rm tools/phantomjs/phantomjs + rm tools/phantomjs/phantomjs || true else echo 'PhantomJS binaries for Windows missing!' fi go run build.go -goos windows -pkg-arch amd64 ${OPT} package-only -go run build.go latest \ No newline at end of file +go run build.go latest