Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Construct the image name directly within the build target #129

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ PLATFORMS := $(if $(filter all,$(PLATFORMS)),$(PLATFORM_LIST),$(PLATFORMS))
# export PLATFORMS=linux/arm64,linux/s390x,linux/amd64
# or export PLATFORMS=all to automatically include all supported platforms.
DOCKER_BUILDER ?= macvtap-docker-builder
MACVTAP_IMAGE_TAGGED := ${IMAGE_REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}

# Make does not offer a recursive wildcard function, so here's one:
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
Expand Down Expand Up @@ -82,20 +81,20 @@ vet: $(go_sources) $(GO)

docker-build:
ifeq ($(OCI_BIN),podman)
$(MAKE) build-multiarch-macvtap-podman
$(MAKE) build-multiarch-macvtap-podman MACVTAP_IMAGE_TAGGED=$(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)
else ifeq ($(OCI_BIN),docker)
$(MAKE) build-multiarch-macvtap-docker
$(MAKE) build-multiarch-macvtap-docker MACVTAP_IMAGE_TAGGED=$(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)
else
$(error Unsupported OCI_BIN value: $(OCI_BIN))
endif

docker-push:
ifeq ($(OCI_BIN),podman)
podman manifest push --tls-verify=false ${MACVTAP_IMAGE_TAGGED} ${MACVTAP_IMAGE_TAGGED}
podman manifest push --tls-verify=false $(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG) $(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)
endif

docker-tag-latest:
$(OCI_BIN) tag ${IMAGE_REGISTRY}/${IMAGE_NAME}:latest ${MACVTAP_IMAGE_TAGGED}
$(OCI_BIN) tag ${IMAGE_REGISTRY}/${IMAGE_NAME}:latest $(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)

cluster-up:
./cluster/up.sh
Expand Down
1 change: 1 addition & 0 deletions automation/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ git config credential.helper '!f() { sleep 1; echo "username=${GITHUB_USER}"; ec

source automation/check-patch.setup.sh
cd ${TMP_PROJECT_PATH}
export PLATFORMS=all
make release
1 change: 1 addition & 0 deletions hack/build-macvtap-podman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ podman manifest rm "${MACVTAP_IMAGE_TAGGED}" 2>/dev/null || true
podman manifest rm "${MARKER_IMAGE_GIT_TAGGED}" 2>/dev/null || true
podman rmi "${MACVTAP_IMAGE_TAGGED}" 2>/dev/null || true
podman rmi "${MARKER_IMAGE_GIT_TAGGED}" 2>/dev/null || true
podman rmi $(podman images --filter "dangling=true" -q) 2>/dev/null || true

podman manifest create "${MACVTAP_IMAGE_TAGGED}"

Expand Down
3 changes: 2 additions & 1 deletion hack/install-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

destination=$1
version=$(grep "^go " go.mod | awk '{print $2}')
tarball=go$version.linux-amd64.tar.gz
arch=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
tarball=go$version.linux-$arch.tar.gz
url=https://dl.google.com/go/

mkdir -p $destination
Expand Down