blob: 3435fb01a9d08c89e397843a3d42aeb69db75bfc [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
David K. Bainbridge56da9572017-08-17 09:56:50 -070022.PHONY: onos
23onos:
24 docker build -t cord/onos:latest -f docker/Dockerfile.onos .
25
Andy Bavier1fd39172017-07-20 15:54:11 -070026.PHONY: publish
27publish:
28 docker tag $(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) $(DOCKER_REGISTRY)/$(IMAGE_NAME):$(DEPLOY_DOCKER_TAG)
29 docker push $(DOCKER_REGISTRY)/$(IMAGE_NAME):$(DEPLOY_DOCKER_TAG)
Andy Bavier25ebf0e2017-06-06 18:27:15 -040030
31.PHONY: clean
32clean:
Andy Bavier1fd39172017-07-20 15:54:11 -070033 docker rmi $(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) | true
34 docker rmi $(DOCKER_REGISTRY)/$(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) | true
Andy Bavier25ebf0e2017-06-06 18:27:15 -040035
36.PHONY: test
37test:
38 @echo "No unit tests at present"
39
40.PHONY: help
41help:
42 @echo "Available targets:"
Andy Bavier1fd39172017-07-20 15:54:11 -070043 @echo " build: build the Docker image (Maven repo with the CORD ONOS apps)"
Andy Bavier25ebf0e2017-06-06 18:27:15 -040044 @echo " clean: remove the Docker image"
45 @echo " test: run unit tests"
46 @echo " help: print this help message"
47