From 130734827686939f83fd9d34227dd4f80d4971b0 Mon Sep 17 00:00:00 2001 From: Tit Date: Wed, 7 Feb 2018 16:12:11 +0100 Subject: [PATCH] DIND is stupid --- build-docker.sh | 4 ++++ build.sh | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100755 build-docker.sh diff --git a/build-docker.sh b/build-docker.sh new file mode 100755 index 0000000..7b6ff51 --- /dev/null +++ b/build-docker.sh @@ -0,0 +1,4 @@ +#!/bin/bash +docker build --rm -t pendulum-build -f Dockerfile.build . +docker run --rm -it -v $PWD:/go/src/github.com/titpetric/pendulum pendulum-build ./build.sh +docker rmi pendulum-build \ No newline at end of file diff --git a/build.sh b/build.sh index 7048539..814ae51 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ set -e PROJECT=$(basename $(dirname $(readlink -f $0))) -docker run --rm -v $PWD:/go/src/github.com/titpetric/$PROJECT -w /go/src/github.com/titpetric/$PROJECT -e GOOS=linux -e GOARCH=${ARCH} -e CGO_ENABLED=0 -e GOARM=7 titpetric/golang go generate +go generate NAMES=$(ls cmd/* -d | xargs -n1 basename) for NAME in $NAMES; do @@ -11,7 +11,7 @@ for NAME in $NAMES; do for ARCH in $ARCHS; do for OS in $OSES; do echo $OS $ARCH $NAME - docker run --rm -v $PWD:/go/src/github.com/titpetric/$PROJECT -w /go/src/github.com/titpetric/$PROJECT -e GOOS=${OS} -e GOARCH=${ARCH} -e CGO_ENABLED=0 -e GOARM=7 titpetric/golang go build -o build/${NAME}-${OS}-${ARCH} cmd/${NAME}/*.go + GOOS=${OS} GOARCH=${ARCH} CGO_ENABLED=0 GOARM=7 go build -o build/${NAME}-${OS}-${ARCH} cmd/${NAME}/*.go if [ $? -eq 0 ]; then echo OK fi