Skip to content

Commit

Permalink
Fix overriding of DOCKER_IMG_VERSION in Makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Pulkit Jain <[email protected]>
  • Loading branch information
jainpulkit22 committed Jul 12, 2024
1 parent 5cee770 commit a73cc75
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ GOLANGCI_LINT_VERSION := v1.54.0
GOLANGCI_LINT_BINDIR := $(CURDIR)/.golangci-bin
GOLANGCI_LINT_BIN := $(GOLANGCI_LINT_BINDIR)/$(GOLANGCI_LINT_VERSION)/golangci-lint

BUILD_TAG :=
ifndef CUSTOM_BUILD_TAG
BUILD_TAG = $(shell build/images/build-tag.sh)
else
BUILD_TAG = $(CUSTOM_BUILD_TAG)
DOCKER_IMG_VERSION = $(CUSTOM_BUILD_TAG)
endif

DOCKER_BUILD_ARGS :=
ifeq ($(NO_PULL),)
DOCKER_BUILD_ARGS += --pull
Expand All @@ -44,7 +36,6 @@ ifneq ($(NO_CACHE),)
endif
DOCKER_BUILD_ARGS += --build-arg OVS_VERSION=$(OVS_VERSION)
DOCKER_BUILD_ARGS += --build-arg GO_VERSION=$(GO_VERSION)
DOCKER_BUILD_ARGS += --build-arg BUILD_TAG=$(BUILD_TAG)

export CGO_ENABLED

Expand All @@ -53,6 +44,15 @@ all: build

include versioning.mk

BUILD_TAG :=
ifndef CUSTOM_BUILD_TAG
BUILD_TAG = $(shell build/images/build-tag.sh)
else
BUILD_TAG = $(CUSTOM_BUILD_TAG)
DOCKER_IMG_VERSION = $(CUSTOM_BUILD_TAG)
endif
DOCKER_BUILD_ARGS += --build-arg BUILD_TAG=$(BUILD_TAG)

LDFLAGS += $(VERSION_LDFLAGS)

UNAME_S := $(shell uname -s)
Expand Down
4 changes: 2 additions & 2 deletions ci/jenkins/jobs/macros.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
./ci/kind/kind-setup.sh --antrea-cni create "${{FULL_CLUSTER_NAME}}" --ip-family '{ip_version}'
kind export kubeconfig -n "${{FULL_CLUSTER_NAME}}" --kubeconfig ${{PWD}}/.kube/config
set +e
./ci/jenkins/test.sh --testcase '{conformance_type}' --registry ${{DOCKER_REGISTRY}} --kubeconfig ${{PWD}}/.kube/config --testbed-type "kind" --kind-cluster-name "${{FULL_CLUSTER_NAME}}" --build-tag "${conformance_type}-${{BUILD_NUMBER}}"
./ci/jenkins/test.sh --testcase '{conformance_type}' --registry ${{DOCKER_REGISTRY}} --kubeconfig ${{PWD}}/.kube/config --testbed-type "kind" --kind-cluster-name "${{FULL_CLUSTER_NAME}}"
return_code=$?
set -ex
./ci/kind/kind-setup.sh destroy "${{FULL_CLUSTER_NAME}}"
Expand All @@ -248,7 +248,7 @@
./ci/kind/kind-setup.sh --antrea-cni create "${{FULL_CLUSTER_NAME}}" --ip-family '{ip_version}'
kind export kubeconfig -n "${{FULL_CLUSTER_NAME}}" --kubeconfig ${{PWD}}/.kube/config
set +e
./ci/jenkins/test.sh --testcase e2e --registry ${{DOCKER_REGISTRY}} --kubeconfig ${{PWD}}/.kube/config --testbed-type "kind" --kind-cluster-name "${{FULL_CLUSTER_NAME}}" --build-tag "e2e-${{BUILD_NUMBER}}"
./ci/jenkins/test.sh --testcase e2e --registry ${{DOCKER_REGISTRY}} --kubeconfig ${{PWD}}/.kube/config --testbed-type "kind" --kind-cluster-name "${{FULL_CLUSTER_NAME}}"
return_code=$?
set -ex
./ci/kind/kind-setup.sh destroy "${{FULL_CLUSTER_NAME}}"
Expand Down
2 changes: 1 addition & 1 deletion ci/jenkins/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function clean_antrea {
for antrea_yml in ${WORKDIR}/*.yml; do
kubectl delete -f $antrea_yml --ignore-not-found=true || true
done
docker images --format "{{.Repository}}:{{.Tag}}" | grep 'antrea'| xargs -r docker rmi || true
docker images --format "{{.Repository}}:{{.Tag}}" | grep '${BUILD_TAG}' | xargs -r docker rmi || true
docker images | grep '<none>' | awk '{print $3}' | xargs -r docker rmi || true
check_and_cleanup_docker_build_cache
}
Expand Down

0 comments on commit a73cc75

Please sign in to comment.