blob: d59556552339c22473ab521314758338ac0aca82 [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)")
Andy Bavier67282ee2017-08-16 16:37:24 -070012include $(MAKE_CONFIG)
Andy Bavier1fd39172017-07-20 15:54:11 -070013endif
Andy Bavier25ebf0e2017-06-06 18:27:15 -040014
15.PHONY: all
Andy Bavier1fd39172017-07-20 15:54:11 -070016all: build
Andy Bavier25ebf0e2017-06-06 18:27:15 -040017
Andy Bavier1fd39172017-07-20 15:54:11 -070018.PHONY: build
19build:
20 docker build -f Dockerfile.make -t $(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) $(ROOT_DIR)
21
22.PHONY: publish
23publish:
24 docker tag $(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) $(DOCKER_REGISTRY)/$(IMAGE_NAME):$(DEPLOY_DOCKER_TAG)
25 docker push $(DOCKER_REGISTRY)/$(IMAGE_NAME):$(DEPLOY_DOCKER_TAG)
Andy Bavier25ebf0e2017-06-06 18:27:15 -040026
27.PHONY: clean
28clean:
Andy Bavier1fd39172017-07-20 15:54:11 -070029 docker rmi $(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) | true
30 docker rmi $(DOCKER_REGISTRY)/$(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) | true
Andy Bavier25ebf0e2017-06-06 18:27:15 -040031
32.PHONY: test
33test:
34 @echo "No unit tests at present"
35
36.PHONY: help
37help:
38 @echo "Available targets:"
Andy Bavier1fd39172017-07-20 15:54:11 -070039 @echo " build: build the Docker image (Maven repo with the CORD ONOS apps)"
Andy Bavier25ebf0e2017-06-06 18:27:15 -040040 @echo " clean: remove the Docker image"
41 @echo " test: run unit tests"
42 @echo " help: print this help message"
43