Skip to content

Commit

Permalink
Update build setup to publish sonobuoy binary and image for s390x
Browse files Browse the repository at this point in the history
Signed-off-by: Yulia Gaponenko <[email protected]>
  • Loading branch information
barthy1 authored and johnSchnake committed Oct 19, 2021
1 parent 17b7050 commit 06f5616
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,22 @@ builds:
- arm64
- 386
- ppc64le
- s390x
ignore:
- goos: darwin
goarch: 386
- goos: darwin
goarch: arm64
- goos: darwin
goarch: ppc64le
- goos: darwin
goarch: s390x
- goos: windows
goarch: arm64
- goos: windows
goarch: ppc64le
- goos: windows
goarch: s390x
ldflags: -s -w -X github.com/vmware-tanzu/sonobuoy/pkg/buildinfo.Version=v{{.Version}} -X github.com/vmware-tanzu/sonobuoy/pkg/buildinfo.GitSHA={{.FullCommit}}
archives:
- id: tar
Expand Down
7 changes: 6 additions & 1 deletion scripts/build_funcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TARGET=sonobuoy
GOTARGET=github.com/vmware-tanzu/"$TARGET"
GOPATH=$(go env GOPATH)
REGISTRY=sonobuoy
LINUX_ARCH=(amd64 arm64 ppc64le)
LINUX_ARCH=(amd64 arm64 ppc64le s390x)

# Currently only under a single arch, can iterate over these and still assume arch value.
WIN_ARCH=amd64
Expand All @@ -32,6 +32,7 @@ BUILD_IMAGE=golang:1.16
AMD_IMAGE=gcr.io/distroless/static:nonroot
ARM_IMAGE=gcr.io/distroless/static:nonroot-arm64
PPC64LE_IMAGE=gcr.io/distroless/static:nonroot-ppc64le
S390X_IMAGE=gcr.io/distroless/static:nonroot-s390x
WIN_AMD64_BASEIMAGE=mcr.microsoft.com/windows/nanoserver
TEST_IMAGE=testimage:v0.1
KIND_CLUSTER=kind
Expand Down Expand Up @@ -112,6 +113,10 @@ gen_dockerfile_for_os_arch(){
sed -e "s|BASEIMAGE|$PPC64LE_IMAGE|g" \
-e 's|CMD1||g' \
-e 's|BINARY|build/linux/ppc64le/sonobuoy|g' Dockerfile > "$dockerfile"
elif [ "$2" = "s390x" ]; then
sed -e "s|BASEIMAGE|$S390X_IMAGE|g" \
-e 's|CMD1||g' \
-e 's|BINARY|build/linux/s390x/sonobuoy|g' Dockerfile > "$dockerfile"
else
echo "Linux ARCH unknown"
fi
Expand Down

0 comments on commit 06f5616

Please sign in to comment.