CORD-1401 Cleanup targets for POD / CiaB builds
Change-Id: I2b901c70e33d9a79953aac3d4292662ae885607e
diff --git a/Makefile b/Makefile
index 606a6d7..dfe099a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,32 @@
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
-IMAGE_NAME=opencord/mavenrepo
-PACKAGE_TAG=candidate
+IMAGE_NAME ?= opencord/mavenrepo
+DOCKER_REGISTRY ?= docker-registry:5000
+DEPLOY_DOCKER_TAG ?= candidate
+
+MAKE_CONFIG ?= config.mk
+ifeq ($(realpath $(MAKE_CONFIG)),)
+$(info Makefile configuration not found, defaults will be used.)
+else
+$(info Using makefile configuration "$(MAKE_CONFIG)")
+endif
.PHONY: all
-all: images
+all: build
-.PHONY: images
-images:
- docker build -f Dockerfile.make -t $(IMAGE_NAME):$(PACKAGE_TAG) $(ROOT_DIR)
+.PHONY: build
+build:
+ docker build -f Dockerfile.make -t $(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) $(ROOT_DIR)
+
+.PHONY: publish
+publish:
+ docker tag $(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) $(DOCKER_REGISTRY)/$(IMAGE_NAME):$(DEPLOY_DOCKER_TAG)
+ docker push $(DOCKER_REGISTRY)/$(IMAGE_NAME):$(DEPLOY_DOCKER_TAG)
.PHONY: clean
clean:
- docker rmi opencord/mavenrepo:$(PACKAGE_TAG) | true
+ docker rmi $(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) | true
+ docker rmi $(DOCKER_REGISTRY)/$(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) | true
.PHONY: test
test:
@@ -21,7 +35,7 @@
.PHONY: help
help:
@echo "Available targets:"
- @echo " images: build the Docker image (Maven repo with the CORD ONOS apps)"
+ @echo " build: build the Docker image (Maven repo with the CORD ONOS apps)"
@echo " clean: remove the Docker image"
@echo " test: run unit tests"
@echo " help: print this help message"