scripts/release-with-rkt.sh Minor improvements
authorTom Denham <tom@tomdee.co.uk>
Fri, 7 Apr 2017 20:54:39 +0000 (13:54 -0700)
committerTom Denham <tom@tomdee.co.uk>
Fri, 7 Apr 2017 20:54:39 +0000 (13:54 -0700)
- Use a new Fedora to get a more up to date Go version
- Don't build so many archives, they are not used.
- Handle the new build.sh script
- Just use host networking with rkt

scripts/release-with-rkt.sh

index dbc3551..e7cf96f 100755 (executable)
@@ -4,7 +4,7 @@ set -xe
 SRC_DIR="${SRC_DIR:-$PWD}"
 
 FEDORA_INSTALL="dnf install -y golang tar xz bzip2 gzip sudo iproute wget"
-FEDORA_IMAGE="docker://fedora:23"
+FEDORA_IMAGE="docker://fedora:25"
 ACBUILD_URL="https://github.com/appc/acbuild/releases/download/v0.2.2/acbuild.tar.gz"
 ACBUILD="acbuild --debug"
 BUILDFLAGS="-a --ldflags '-extldflags \"-static\"'"
@@ -17,19 +17,19 @@ rm -Rf ${SRC_DIR}/${RELEASE_DIR}
 mkdir -p ${SRC_DIR}/${RELEASE_DIR}
 
 sudo -E rkt run \
-    --volume rslvconf,kind=host,source=/etc/resolv.conf \
-    --mount volume=rslvconf,target=/etc/resolv.conf \
     --volume src-dir,kind=host,source=$SRC_DIR \
     --mount volume=src-dir,target=/opt/src \
     --interactive \
     --insecure-options=image \
+    --net=host \
+    --dns=host \
     ${FEDORA_IMAGE} \
     --exec /bin/bash \
     -- -xe -c "\
     ${FEDORA_INSTALL}; cd /opt/src; umask 0022; 
     for arch in amd64 arm arm64 ppc64le s390x; do \
-        CGO_ENABLED=0 GOARCH=\$arch ./build ${BUILDFLAGS}; \
-        for format in txz tbz2 tgz; do \
+        CGO_ENABLED=0 GOARCH=\$arch ./build.sh ${BUILDFLAGS}; \
+        for format in tgz; do \
             FILENAME=cni-\$arch-${TAG}.\$format; \
             FILEPATH=${RELEASE_DIR}/\$FILENAME; \
             tar -C ${OUTPUT_DIR} --owner=0 --group=0 -caf \$FILEPATH .; \