From b72799c13fec763a313bf0a9de5adb7216c7d59c Mon Sep 17 00:00:00 2001 From: Dan Pock Date: Tue, 30 Jul 2024 16:28:25 -0400 Subject: [PATCH 1/2] Add target arch env This makes it easier to target a cross arch compile --- Dockerfile.dapper | 2 +- scripts/version | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile.dapper b/Dockerfile.dapper index f4daa017..75cd37a4 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -18,7 +18,7 @@ RUN if [ "${ARCH}" != "s390x" ]; then \ fi -ENV DAPPER_ENV REPO TAG DRONE_TAG CROSS CROSS_ARCH USE_DOCKER_BUILDX +ENV DAPPER_ENV REPO TAG DRONE_TAG CROSS CROSS_ARCH USE_DOCKER_BUILDX TARGET_ARCH ENV DAPPER_SOURCE /go/src/github.com/rancher/backup-restore-operator/ ENV DAPPER_OUTPUT ./bin ./dist ENV GOCACHE /root/.cache/go-build diff --git a/scripts/version b/scripts/version index c43d1cc8..80192a4b 100755 --- a/scripts/version +++ b/scripts/version @@ -14,6 +14,7 @@ else VERSION="${COMMIT}${DIRTY}" fi +ARCH=$TARGET_ARCH if [ -z "$ARCH" ]; then ARCH=$(go env GOHOSTARCH) fi From 29713be65459806d1e8b727cfc171fd24b317c9a Mon Sep 17 00:00:00 2001 From: Dan Pock Date: Tue, 30 Jul 2024 16:28:44 -0400 Subject: [PATCH 2/2] Fix package script bug --- scripts/package | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/package b/scripts/package index 3866713b..0bd41564 100755 --- a/scripts/package +++ b/scripts/package @@ -18,8 +18,8 @@ if [[ ${USE_DOCKER_BUILDX} -eq 1 ]]; then else docker build -f ${DOCKERFILE} -t ${IMAGE} . fi -echo Built ${IMAGE} -docker image save rancher/backup-restore-operator:$TAG -o ./dist/artifacts/backup-restore-operator.img +echo Built ${IMAGE} +docker image save ${IMAGE} -o ./dist/artifacts/backup-restore-operator.img ./scripts/package-helm