blob: dfe099af37c6de720bac2d8b6a43877445e4481b [file] [log] [blame]
Andy Bavier25ebf0e2017-06-06 18:27:15 -04001ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
2
Andy Bavier1fd39172017-07-20 15:54:11 -07003IMAGE_NAME ?= opencord/mavenrepo
4DOCKER_REGISTRY ?= docker-registry:5000
5DEPLOY_DOCKER_TAG ?= candidate
6
7MAKE_CONFIG ?= config.mk
8ifeq ($(realpath $(MAKE_CONFIG)),)
9$(info Makefile configuration not found, defaults will be used.)
10else
11$(info Using makefile configuration "$(MAKE_CONFIG)")
12endif
Andy Bavier25ebf0e2017-06-06 18:27:15 -040013
14.PHONY: all
Andy Bavier1fd39172017-07-20 15:54:11 -070015all: build
Andy Bavier25ebf0e2017-06-06 18:27:15 -040016
Andy Bavier1fd39172017-07-20 15:54:11 -070017.PHONY: build
18build:
19 docker build -f Dockerfile.make -t $(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) $(ROOT_DIR)
20
21.PHONY: publish
22publish:
23 docker tag $(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) $(DOCKER_REGISTRY)/$(IMAGE_NAME):$(DEPLOY_DOCKER_TAG)
24 docker push $(DOCKER_REGISTRY)/$(IMAGE_NAME):$(DEPLOY_DOCKER_TAG)
Andy Bavier25ebf0e2017-06-06 18:27:15 -040025
26.PHONY: clean
27clean:
Andy Bavier1fd39172017-07-20 15:54:11 -070028 docker rmi $(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) | true
29 docker rmi $(DOCKER_REGISTRY)/$(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) | true
Andy Bavier25ebf0e2017-06-06 18:27:15 -040030
31.PHONY: test
32test:
33 @echo "No unit tests at present"
34
35.PHONY: help
36help:
37 @echo "Available targets:"
Andy Bavier1fd39172017-07-20 15:54:11 -070038 @echo " build: build the Docker image (Maven repo with the CORD ONOS apps)"
Andy Bavier25ebf0e2017-06-06 18:27:15 -040039 @echo " clean: remove the Docker image"
40 @echo " test: run unit tests"
41 @echo " help: print this help message"
42