Skip to content

Commit bdd713d

Browse files
committed
Removed unused Makefile targets
This patch removes unused Makefile targets as a step towards using the new hack/release.sh script. To that end, we also standardize the version string retrieved via `git describe` across the project.
1 parent 91b7835 commit bdd713d

File tree

4 files changed

+6
-54
lines changed

4 files changed

+6
-54
lines changed

Makefile

+1-46
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,11 @@ CWD := $(abspath .)
2727
SHELL := hack/shell-with-gopath.sh
2828

2929
# Image URL to use all building/pushing image targets
30-
PRODUCTION_IMG ?= gcr.io/cnx-cluster-api/vsphere-cluster-api-provider:0.3.0
3130
CI_IMG ?= gcr.io/cnx-cluster-api/vsphere-cluster-api-provider
3231
CLUSTERCTL_CI_IMG ?= gcr.io/cnx-cluster-api/clusterctl
33-
DEV_IMG ?= # <== NOTE: outside dev, change this!!!
3432

3533
# Retrieves the git hash
36-
VERSION ?= $(shell git describe --exact-match 2> /dev/null || \
37-
git describe --match=$(git rev-parse --short=8 HEAD) --always --dirty --abbrev=8)
34+
VERSION ?= $(shell git describe --always --dirty)
3835

3936
# Build manager binary
4037
manager: check
@@ -92,52 +89,10 @@ vendor:
9289
cp -rf --no-preserve=mode "$${_src}" "$${_dst}"
9390
.PHONY: vendor
9491

95-
####################################
96-
# DEVELOPMENT Build and Push targets
97-
####################################
98-
99-
# Create YAML file for deployment
100-
dev-yaml:
101-
CAPV_MANAGER_IMAGE=$(DEV_IMG) hack/generate-yaml.sh
102-
103-
# Build the docker image
104-
dev-build: #test
105-
docker build . -t $(DEV_IMG)
106-
107-
# Push the docker image
108-
dev-push:
109-
docker push $(DEV_IMG)
110-
111-
.PHONY: dev-yaml dev-build dev-push
112-
113-
###################################
114-
# PRODUCTION Build and Push targets
115-
###################################
116-
117-
# Create YAML file for deployment
118-
prod-yaml:
119-
CAPV_MANAGER_IMAGE=$(PRODUCTION_IMG) hack/generate-yaml.sh
120-
121-
# Build the docker image
122-
prod-build: test
123-
docker build . -t $(PRODUCTION_IMG)
124-
125-
# Push the docker image
126-
prod-push:
127-
@echo "logging into gcr.io registry with key file"
128-
@docker login -u _json_key --password-stdin gcr.io <"$(GCR_KEY_FILE)"
129-
docker push $(PRODUCTION_IMG)
130-
131-
.PHONY: prod-yaml prod-build prod-push
132-
13392
###################################
13493
# CI Build and Push targets
13594
###################################
13695

137-
# Create YAML file for deployment into CI
138-
ci-yaml:
139-
CAPV_MANAGER_IMAGE=$(CI_IMG) hack/generate-yaml.sh
140-
14196
ci-image: generate fmt vet manifests
14297
docker build . -t "$(CI_IMG):$(VERSION)"
14398
docker build . -f cmd/clusterctl/Dockerfile -t "$(CLUSTERCTL_CI_IMG):$(VERSION)"

scripts/e2e/bootstrap_job/Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Makefile
22

3-
VERSION ?= $(shell git describe --exact-match 2> /dev/null || \
4-
git describe --match=$(git rev-parse --short=8 HEAD) --always --dirty --abbrev=8)
3+
VERSION ?= $(shell git describe --always --dirty)
54
REGISTRY ?=gcr.io/cnx-cluster-api/cluster-api-provider-vsphere-ci
65

76
all: build

scripts/e2e/e2e.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ vsphere_controller_version=""
166166
if [ -z "${PROW_JOB_ID}" ] ; then
167167
CONTEXT="debug"
168168
start_docker
169-
vsphere_controller_version=$(shell git describe --exact-match 2> /dev/null || \
170-
git describe --match="$(git rev-parse --short=8 HEAD)" --always --dirty --abbrev=8)
169+
vsphere_controller_version=$(shell git describe --always --dirty)
171170
else
172171
CONTEXT="prow"
173172
if [ -z "${PULL_PULL_SHA}" ] ; then

scripts/e2e/hack/Makefile

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
# Makefile
22

3-
VERSION ?= $(shell git describe --exact-match 2> /dev/null || \
4-
git describe --match=$(git rev-parse --short=8 HEAD) --always --dirty --abbrev=8)
3+
VERSION ?= $(shell git describe --always --dirty)
54
REGISTRY ?=gcr.io/cnx-cluster-api/cluster-api-provider-vsphere-ci-debug
65

76
all: build push clean
87
.PHONY : all
98

109
.PHONY : build
11-
build:
10+
build:
1211
cd ../../../../ && docker build . -f ./cluster-api-provider-vsphere/scripts/e2e/hack/Dockerfile --tag $(REGISTRY):$(VERSION)
1312
docker tag $(REGISTRY):$(VERSION) $(REGISTRY):debug
14-
13+
1514
push: build
1615
@echo "logging into gcr.io registry with key file"
1716
@echo $$GCR_KEY_FILE | docker login -u _json_key --password-stdin gcr.io

0 commit comments

Comments
 (0)