diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index a558406b5204075561dcd210ce529da1f8a70c56..b2637cb19713ff286a201fdc3c8049598e2d7c7a 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: [linux] - arch: [amd64, arm64] + arch: [amd64, arm64, arm] steps: - name: Add Git run: apk add -U git diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a4586cdca290809bf1175e5c3280f90fa6e592e1..20a27a6d04810d1fc0f99d4a7681ae476fadc7bf 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,7 +21,7 @@ jobs: strategy: matrix: os: [linux] - arch: [amd64, arm64] + arch: [amd64, arm64, arm] steps: - name: Add Git run: apk add -U git @@ -138,4 +138,4 @@ jobs: tags: rancher/system-upgrade-controller:${{ env.TAG }} file: package/Dockerfile target: controller - platforms: linux/amd64, linux/arm64 + platforms: linux/amd64, linux/arm64, linux/arm diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 9fbdd3c1eadd24be2ffaad1eb130d29bb1ea53f9..4225b27dc122bac8c3ea41b2aa5fe5365f703d1e 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -17,7 +17,7 @@ RUN if [ "${ARCH:-$(go env GOARCH)}" = "amd64" ]; then \ chmod +x /usr/local/bin/docker-compose; \ fi RUN mkdir -p /usr/local/lib/docker/cli-plugins; \ - curl -o /usr/local/lib/docker/cli-plugins/docker-buildx -fsSL "https://github.com/docker/buildx/releases/download/v0.16.2/buildx-v0.16.2.linux-${ARCH}"; \ + curl -o /usr/local/lib/docker/cli-plugins/docker-buildx -fsSL "https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-amd64"; \ chmod +x /usr/local/lib/docker/cli-plugins/docker-buildx ENV DAPPER_ENV REPO TAG DRONE_TAG ENV DAPPER_SOURCE /go/src/github.com/rancher/system-upgrade-controller/ diff --git a/scripts/build-controller b/scripts/build-controller index f651bb3b6271867c8401786c52702c9e92138429..bb110e7d996810940595687d75e6bc53a5cd277c 100755 --- a/scripts/build-controller +++ b/scripts/build-controller @@ -9,4 +9,4 @@ mkdir -p bin [ "$(uname)" != "Darwin" ] && LINKFLAGS="-extldflags -static -s" echo "Building $PKG ..." VERSIONFLAGS="-X ${PKG}/pkg/version.Version=${VERSION} -X ${PKG}/pkg/version.GitCommit=${COMMIT:0:8}" -CGO_ENABLED=0 go build -ldflags "$VERSIONFLAGS $LINKFLAGS" -o bin/system-upgrade-controller +CGO_ENABLED=0 GOARCH=$ARCH go build -ldflags "$VERSIONFLAGS $LINKFLAGS" -o bin/system-upgrade-controller diff --git a/scripts/build-e2e-tests b/scripts/build-e2e-tests index 8dbac0886aceab0f7b5a2e216a06114323d37e84..dfeff5d59dc47f4f370c89291bb4c52cffd13f45 100755 --- a/scripts/build-e2e-tests +++ b/scripts/build-e2e-tests @@ -9,4 +9,4 @@ mkdir -p bin [ "$(uname)" != "Darwin" ] && LINKFLAGS="-extldflags -static -s" echo "Building $PKG/e2e ..." VERSIONFLAGS="-X ${PKG}/pkg/version.Version=${VERSION} -X ${PKG}/pkg/version.GitCommit=${COMMIT:0:8}" -CGO_ENABLED=0 go test -c -ldflags "$VERSIONFLAGS $LINKFLAGS" -o bin/system-upgrade-controller.test ./e2e/suite/... +CGO_ENABLED=0 GOARCH=$ARCH go test -c -ldflags "$VERSIONFLAGS $LINKFLAGS" -o bin/system-upgrade-controller.test ./e2e/suite/... diff --git a/scripts/package-controller b/scripts/package-controller index 42ce638dab8fe306859a26fd04b01a13b2ffc44f..7f992415352cf1e093f30d88ce12b5bac60f4b37 100755 --- a/scripts/package-controller +++ b/scripts/package-controller @@ -6,7 +6,7 @@ source $(dirname $0)/version cd $(dirname $0)/.. docker buildx build \ - --build-arg TARGETARCH=${ARCH} \ + --platform linux/${ARCH} \ --build-arg REPO=${REPO} \ --build-arg TAG=${TAG} \ --build-arg VERSION=${VERSION} \ diff --git a/scripts/package-e2e-tests b/scripts/package-e2e-tests index 2dc3142ca7933b545f2bba2128720a4c4a0d9ea4..3972cd0eba59afea26314ad963bafbba258468f7 100755 --- a/scripts/package-e2e-tests +++ b/scripts/package-e2e-tests @@ -5,8 +5,12 @@ source $(dirname $0)/version cd $(dirname $0)/.. +if [ "$ARCH" != "amd64" ]; then + exit 0 +fi + docker buildx build \ - --build-arg TARGETARCH=${ARCH} \ + --platform linux/${ARCH} \ --build-arg REPO=${REPO} \ --build-arg TAG=${TAG} \ --build-arg VERSION=${VERSION} \ @@ -24,11 +28,9 @@ docker image save --output ./dist/artifacts/system-upgrade-controller-e2e-tests- echo ${REPO}/system-upgrade-controller:${TAG}-e2e-tests >> ./dist/images.txt echo Built ${REPO}/system-upgrade-controller:${TAG}-e2e-tests -if [ "$ARCH" = "amd64" ]; then - sonobuoy gen plugin \ - --format=junit \ - --image ${REPO}/system-upgrade-controller:${VERSION}-e2e-tests \ - --name system-upgrade-controller \ - --type job \ - > ./dist/artifacts/system-upgrade-controller-e2e-tests.yaml -fi +sonobuoy gen plugin \ + --format=junit \ + --image ${REPO}/system-upgrade-controller:${VERSION}-e2e-tests \ + --name system-upgrade-controller \ + --type job \ +> ./dist/artifacts/system-upgrade-controller-e2e-tests.yaml diff --git a/scripts/validate b/scripts/validate index 850c72f8d3b0ed6b11c9866cb520f0b8cbbe1f96..f5db1b8ec16af1606ca62d2fa2138cc0f853b01a 100755 --- a/scripts/validate +++ b/scripts/validate @@ -3,10 +3,10 @@ set -e cd $(dirname $0)/.. -echo Running validation - PACKAGES="$(go list ./...)" +file bin/* + if ! command -v golangci-lint; then echo Skipping validation: no golangci-lint available exit