Skip to content

Commit

Permalink
Removed unused Makefile targets
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
codenrhoden committed Jul 23, 2019
1 parent 91b7835 commit bdd713d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 54 deletions.
47 changes: 1 addition & 46 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,11 @@ CWD := $(abspath .)
SHELL := hack/shell-with-gopath.sh

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

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

# Build manager binary
manager: check
Expand Down Expand Up @@ -92,52 +89,10 @@ vendor:
cp -rf --no-preserve=mode "$${_src}" "$${_dst}"
.PHONY: vendor

####################################
# DEVELOPMENT Build and Push targets
####################################

# Create YAML file for deployment
dev-yaml:
CAPV_MANAGER_IMAGE=$(DEV_IMG) hack/generate-yaml.sh

# Build the docker image
dev-build: #test
docker build . -t $(DEV_IMG)

# Push the docker image
dev-push:
docker push $(DEV_IMG)

.PHONY: dev-yaml dev-build dev-push

###################################
# PRODUCTION Build and Push targets
###################################

# Create YAML file for deployment
prod-yaml:
CAPV_MANAGER_IMAGE=$(PRODUCTION_IMG) hack/generate-yaml.sh

# Build the docker image
prod-build: test
docker build . -t $(PRODUCTION_IMG)

# Push the docker image
prod-push:
@echo "logging into gcr.io registry with key file"
@docker login -u _json_key --password-stdin gcr.io <"$(GCR_KEY_FILE)"
docker push $(PRODUCTION_IMG)

.PHONY: prod-yaml prod-build prod-push

###################################
# CI Build and Push targets
###################################

# Create YAML file for deployment into CI
ci-yaml:
CAPV_MANAGER_IMAGE=$(CI_IMG) hack/generate-yaml.sh

ci-image: generate fmt vet manifests
docker build . -t "$(CI_IMG):$(VERSION)"
docker build . -f cmd/clusterctl/Dockerfile -t "$(CLUSTERCTL_CI_IMG):$(VERSION)"
Expand Down
3 changes: 1 addition & 2 deletions scripts/e2e/bootstrap_job/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Makefile

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

all: build
Expand Down
3 changes: 1 addition & 2 deletions scripts/e2e/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ vsphere_controller_version=""
if [ -z "${PROW_JOB_ID}" ] ; then
CONTEXT="debug"
start_docker
vsphere_controller_version=$(shell git describe --exact-match 2> /dev/null || \
git describe --match="$(git rev-parse --short=8 HEAD)" --always --dirty --abbrev=8)
vsphere_controller_version=$(shell git describe --always --dirty)
else
CONTEXT="prow"
if [ -z "${PULL_PULL_SHA}" ] ; then
Expand Down
7 changes: 3 additions & 4 deletions scripts/e2e/hack/Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
# Makefile

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

all: build push clean
.PHONY : all

.PHONY : build
build:
build:
cd ../../../../ && docker build . -f ./cluster-api-provider-vsphere/scripts/e2e/hack/Dockerfile --tag $(REGISTRY):$(VERSION)
docker tag $(REGISTRY):$(VERSION) $(REGISTRY):debug

push: build
@echo "logging into gcr.io registry with key file"
@echo $$GCR_KEY_FILE | docker login -u _json_key --password-stdin gcr.io
Expand Down

0 comments on commit bdd713d

Please sign in to comment.