Squashed 'release-tools/' changes from c0a4fb1d..5489de6e
https://github.com/kubernetes-csi/csi-release-tools/commit/5489de6e Merge https://github.com/kubernetes-csi/csi-release-tools/pull/174 from mauriciopoppe/bump-kind-version https://github.com/kubernetes-csi/csi-release-tools/commit/0c675d4c Bump kind version to v0.11.1 https://github.com/kubernetes-csi/csi-release-tools/commit/ef69a88d Merge https://github.com/kubernetes-csi/csi-release-tools/pull/173 from nick5616/add-ws2022 https://github.com/kubernetes-csi/csi-release-tools/commit/44c710c5 added WS2022 to build platforms https://github.com/kubernetes-csi/csi-release-tools/commit/0883be4f Merge https://github.com/kubernetes-csi/csi-release-tools/pull/171 from pohly/example-commands https://github.com/kubernetes-csi/csi-release-tools/commit/02cda510 build.make: support binaries outside of cmd, with optional go.mod https://github.com/kubernetes-csi/csi-release-tools/commit/65922ea2 Merge https://github.com/kubernetes-csi/csi-release-tools/pull/170 from pohly/canary-snapshot-controller https://github.com/kubernetes-csi/csi-release-tools/commit/c0bdfb3a prow.sh: deploy canary snapshot-controller in canary jobs https://github.com/kubernetes-csi/csi-release-tools/commit/0438f15a Merge https://github.com/kubernetes-csi/csi-release-tools/pull/167 from c0va23/feature/release-armv7-image https://github.com/kubernetes-csi/csi-release-tools/commit/4786f4d0 Merge https://github.com/kubernetes-csi/csi-release-tools/pull/168 from msau42/update-release-prereq https://github.com/kubernetes-csi/csi-release-tools/commit/6a2dc64a Remove requirement to be top-level approver. Only maintainers membership is required to do a release https://github.com/kubernetes-csi/csi-release-tools/commit/30a4f7bb Release armv7 image https://github.com/kubernetes-csi/csi-release-tools/commit/ac8108f1 Merge https://github.com/kubernetes-csi/csi-release-tools/pull/165 from consideRatio/pr/update-github-links-ref-to-master-to-HEAD https://github.com/kubernetes-csi/csi-release-tools/commit/999b483d docs: make github links reference HEAD instead of main https://github.com/kubernetes-csi/csi-release-tools/commit/fd670693 docs: make github links reference HEAD instead of master git-subtree-dir: release-tools git-subtree-split: 5489de6e743cf8362e5ab8275988cc748d0758b0
This commit is contained in:
14
build.make
14
build.make
@@ -21,6 +21,10 @@ SHELL := /bin/bash
|
||||
# set in main Makefile of a repository.
|
||||
# CMDS=
|
||||
|
||||
# Normally, commands are expected in "cmd". That can be changed for a
|
||||
# repository to something else by setting CMDS_DIR before including build.make.
|
||||
CMDS_DIR ?= cmd
|
||||
|
||||
# This is the default. It can be overridden in the main Makefile after
|
||||
# including build.make.
|
||||
REGISTRY_NAME?=quay.io/k8scsi
|
||||
@@ -90,7 +94,7 @@ $(CMDS:%=build-%): build-%: check-go-version-go
|
||||
if ! [ $${#os_arch_seen_pre} = $${#os_arch_seen} ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
if ! (set -x; CGO_ENABLED=0 GOOS="$$os" GOARCH="$$arch" go build $(GOFLAGS_VENDOR) -a -ldflags '$(FULL_LDFLAGS)' -o "./bin/$*$$suffix" ./cmd/$*); then \
|
||||
if ! (set -x; cd ./$(CMDS_DIR)/$* && CGO_ENABLED=0 GOOS="$$os" GOARCH="$$arch" go build $(GOFLAGS_VENDOR) -a -ldflags '$(FULL_LDFLAGS)' -o "$(abspath ./bin)/$*$$suffix" .); then \
|
||||
echo "Building $* for GOOS=$$os GOARCH=$$arch failed, see error(s) above."; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
@@ -98,7 +102,7 @@ $(CMDS:%=build-%): build-%: check-go-version-go
|
||||
done
|
||||
|
||||
$(CMDS:%=container-%): container-%: build-%
|
||||
docker build -t $*:latest -f $(shell if [ -e ./cmd/$*/Dockerfile ]; then echo ./cmd/$*/Dockerfile; else echo Dockerfile; fi) --label revision=$(REV) .
|
||||
docker build -t $*:latest -f $(shell if [ -e ./$(CMDS_DIR)/$*/Dockerfile ]; then echo ./$(CMDS_DIR)/$*/Dockerfile; else echo Dockerfile; fi) --label revision=$(REV) .
|
||||
|
||||
$(CMDS:%=push-%): push-%: container-%
|
||||
set -ex; \
|
||||
@@ -133,7 +137,7 @@ DOCKER_BUILDX_CREATE_ARGS ?=
|
||||
# This target builds a multiarch image for one command using Moby BuildKit builder toolkit.
|
||||
# Docker Buildx is included in Docker 19.03.
|
||||
#
|
||||
# ./cmd/<command>/Dockerfile[.Windows] is used if found, otherwise Dockerfile[.Windows].
|
||||
# ./$(CMDS_DIR)/<command>/Dockerfile[.Windows] is used if found, otherwise Dockerfile[.Windows].
|
||||
# It is currently optional: if no such file exists, Windows images are not included,
|
||||
# even when Windows is listed in BUILD_PLATFORMS. That way, projects can test that
|
||||
# Windows binaries can be built before adding a Dockerfile for it.
|
||||
@@ -146,8 +150,8 @@ $(CMDS:%=push-multiarch-%): push-multiarch-%: check-pull-base-ref build-%
|
||||
export DOCKER_CLI_EXPERIMENTAL=enabled; \
|
||||
docker buildx create $(DOCKER_BUILDX_CREATE_ARGS) --use --name multiarchimage-buildertest; \
|
||||
trap "docker buildx rm multiarchimage-buildertest" EXIT; \
|
||||
dockerfile_linux=$$(if [ -e ./cmd/$*/Dockerfile ]; then echo ./cmd/$*/Dockerfile; else echo Dockerfile; fi); \
|
||||
dockerfile_windows=$$(if [ -e ./cmd/$*/Dockerfile.Windows ]; then echo ./cmd/$*/Dockerfile.Windows; else echo Dockerfile.Windows; fi); \
|
||||
dockerfile_linux=$$(if [ -e ./$(CMDS_DIR)/$*/Dockerfile ]; then echo ./$(CMDS_DIR)/$*/Dockerfile; else echo Dockerfile; fi); \
|
||||
dockerfile_windows=$$(if [ -e ./$(CMDS_DIR)/$*/Dockerfile.Windows ]; then echo ./$(CMDS_DIR)/$*/Dockerfile.Windows; else echo Dockerfile.Windows; fi); \
|
||||
if [ '$(BUILD_PLATFORMS)' ]; then build_platforms='$(BUILD_PLATFORMS)'; else build_platforms="linux amd64"; fi; \
|
||||
if ! [ -f "$$dockerfile_windows" ]; then \
|
||||
build_platforms="$$(echo "$$build_platforms" | sed -e 's/windows *[^ ]* *.exe *[^ ]* *[^ ]*//g' -e 's/; *;/;/g' -e 's/;[ ]*$$//')"; \
|
||||
|
Reference in New Issue
Block a user