Commit c355138e authored by Brad Davidson's avatar Brad Davidson Committed by Brad Davidson

Clean up architecture handling

* Remove unused release.sh and DAPPER_HOST_ARCH * Reliably use ARCH from version.sh * Export GOARCH and GOARM so that they are used by `go build` Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com>
parent 6ba5e546
...@@ -8,10 +8,7 @@ RUN mkdir -p /go/src/golang.org/x && \ ...@@ -8,10 +8,7 @@ RUN mkdir -p /go/src/golang.org/x && \
go install golang.org/x/tools/cmd/goimports && cd go install golang.org/x/tools/cmd/goimports && cd
RUN rm -rf /go/src /go/pkg RUN rm -rf /go/src /go/pkg
ARG DAPPER_HOST_ARCH RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
ENV ARCH $DAPPER_HOST_ARCH
RUN if [ "${ARCH}" == "amd64" ]; then \
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.15.0; \ curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.15.0; \
fi fi
......
...@@ -2,18 +2,16 @@ FROM golang:1.13.15-alpine3.12 ...@@ -2,18 +2,16 @@ FROM golang:1.13.15-alpine3.12
RUN apk -U --no-cache add bash git gcc musl-dev docker curl jq coreutils python2 openssl RUN apk -U --no-cache add bash git gcc musl-dev docker curl jq coreutils python2 openssl
ARG DAPPER_HOST_ARCH ENV SONOBUOY_VERSION 0.19.0
ENV ARCH $DAPPER_HOST_ARCH
RUN if [ "${ARCH}" == "amd64" ] || [ "${ARCH}" == "arm64" ]; then \ RUN OS=linux; \
VERSION=0.18.4 OS=linux && \ ARCH=$(go env GOARCH); \
curl -sL "https://github.com/vmware-tanzu/sonobuoy/releases/download/v${VERSION}/sonobuoy_${VERSION}_${OS}_${ARCH}.tar.gz" | \ RELEASE=$(curl -fs https://storage.googleapis.com/kubernetes-release/release/stable.txt); \
tar -xzf - -C /usr/local/bin; \ if [ "${ARCH}" == "amd64" ] || [ "${ARCH}" == "arm64" ]; then \
fi curl -sL "https://github.com/vmware-tanzu/sonobuoy/releases/download/v${SONOBUOY_VERSION}/sonobuoy_${SONOBUOY_VERSION}_${OS}_${ARCH}.tar.gz" | \
tar -xzf - -C /usr/local/bin; \
RUN curl -sL https://storage.googleapis.com/kubernetes-release/release/$( \ fi; \
curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt \ curl -fsL https://storage.googleapis.com/kubernetes-release/release/${RELEASE}/bin/linux/${ARCH}/kubectl -o /usr/local/bin/kubectl; \
)/bin/linux/${ARCH}/kubectl -o /usr/local/bin/kubectl && \
chmod a+x /usr/local/bin/kubectl chmod a+x /usr/local/bin/kubectl
ENV TEST_CLEANUP true ENV TEST_CLEANUP true
......
...@@ -66,8 +66,9 @@ fi ...@@ -66,8 +66,9 @@ fi
mkdir -p bin mkdir -p bin
if [ -z "$GOARM" ] && [ "arm" = "$(go env GOARCH)" ]; then if [ ${ARCH} = armv7l ] || [ ${ARCH} = arm ]; then
GOARM=7 export GOARCH="arm"
export GOARM="7"
fi fi
rm -f \ rm -f \
......
#!/bin/bash
set -e
cd $(dirname $0)/..
if [ -z "$K3S_ARM64_HOST" ]; then
echo K3S_ARM_HOST must be set
exit 1
fi
if [ -z "$K3S_ARM64_HOST_USER" ]; then
echo K3S_ARM_HOST_USER must be set
exit 1
fi
if [ -z "$K3S_ARM_HOST" ]; then
K3S_ARM_HOST=${K3S_ARM64_HOST}
fi
if [ -z "$K3S_ARM_HOST_USER" ]; then
K3S_ARM_HOST_USER=${K3S_ARM64_HOST_USER}
fi
rm -rf dist
mkdir -p build
make ci > build/build-amd64.log 2>&1 &
AMD_PID=$!
DAPPER_HOST_ARCH=arm DOCKER_HOST="ssh://${K3S_ARM_HOST_USER}@${K3S_ARM_HOST}" make release-arm
DAPPER_HOST_ARCH=arm64 DOCKER_HOST="ssh://${K3S_ARM64_HOST_USER}@${K3S_ARM64_HOST}" make release-arm
echo Waiting for amd64 build to finish
wait -n $AMD_PID || {
cat build/build-amd64.log
exit 1
}
ls -la dist
echo Done
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
set -e -x set -e -x
cd $(dirname $0)/.. cd $(dirname $0)/..
. ./scripts/version.sh
. ./scripts/test-helpers . ./scripts/test-helpers
artifacts=$(pwd)/dist/artifacts artifacts=$(pwd)/dist/artifacts
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment