From 80298df9758115a9509036c5fc94f572a1daf865 Mon Sep 17 00:00:00 2001 From: Udo Waechter Date: Wed, 15 Nov 2023 12:02:29 +0100 Subject: [PATCH] building now --- .project | 11 +++++++++++ scripts/build.sh | 2 +- scripts/download-deps.sh | 30 ++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .project create mode 100755 scripts/download-deps.sh diff --git a/.project b/.project new file mode 100644 index 0000000..a2b8e42 --- /dev/null +++ b/.project @@ -0,0 +1,11 @@ + + + drone-runner-podman + + + + + + + + diff --git a/scripts/build.sh b/scripts/build.sh index f688861..9705cf4 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -13,7 +13,7 @@ set -x # linux - btw, I use amd64 arch linux... okay its manjaro... close enough #GOOS=linux GOARCH=amd64 go build -o release/linux/amd64/drone-runner-podman -GOOS=linux GOARCH=arm64 go build -o release/linux/arm64/drone-runner-podman +GOOS=linux GOARCH=arm64 go build -tags containers_image_openpgp -o release/linux/arm64/drone-runner-podman # GOOS=linux GOARCH=arm go build -o release/linux/arm/drone-runner-podman # GOOS=linux GOARCH=ppc64le go build -o release/linux/ppc64le/drone-runner-podman diff --git a/scripts/download-deps.sh b/scripts/download-deps.sh new file mode 100755 index 0000000..d63dcf9 --- /dev/null +++ b/scripts/download-deps.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +VERSION=${1#"v"} +if [ -z "$VERSION" ]; then + echo "Please specify the Kubernetes version: e.g." + echo "./download-deps.sh v1.21.0" + exit 1 +fi + +set -euo pipefail + +# Find out all the replaced imports, make a list of them. +MODS=($( + curl -sS "https://raw.githubusercontent.com/kubernetes/kubernetes/v${VERSION}/go.mod" | + sed -n 's|.*k8s.io/\(.*\) => ./staging/src/k8s.io/.*|k8s.io/\1|p' +)) + +# Now add those similar replace statements in the local go.mod file, but first find the version that +# the Kubernetes is using for them. +for MOD in "${MODS[@]}"; do + V=$( + go mod download -json "${MOD}@kubernetes-${VERSION}" | + sed -n 's|.*"Version": "\(.*\)".*|\1|p' + ) + + go mod edit "-replace=${MOD}=${MOD}@${V}" +done + +go get "k8s.io/kubernetes@v${VERSION}" +go mod download