blob: 5f799205117671d4fc6978ccbbccf147199b1908 [file] [log] [blame]
Mike Marchetti13d76c82018-09-19 15:00:36 -04001TOPDIR=$(shell readlink -f .|sed -e 's/\/docker\/.*//')
2MKINCLUDE=$(TOPDIR)/docker/mk
3MKBUILD=$(TOPDIR)/docker/build
4
5all: build
6
7TAG ?= latest
8
9REPOSITORY_BASE ?= http://osm-download.etsi.org/repository/osm/debian
10RELEASE ?= ReleaseFOUR-daily
11REPOSITORY_KEY ?= OSM%20ETSI%20Release%20Key.gpg
12REPOSITORY ?= testing
13NO_CACHE ?= --no-cache
14
15LOWER_MDG = $(shell echo $(MDG) | tr '[:upper:]' '[:lower:]')
16
Mike Marchetti9cf41562018-10-01 12:37:59 -040017CONTAINER_NAME ?= $(LOWER_MDG)
18
Mike Marchetti13d76c82018-09-19 15:00:36 -040019CMD_DOCKER_ARGS ?= -q
20DOCKER_ARGS = $(CMD_DOCKER_ARGS)
21
garciadeblas3fad2ea2018-11-29 16:36:50 +010022DEPS := MON IM LCM RO common osmclient devops NBI policy-module Keystone N2VC lightui
Mike Marchetti13d76c82018-09-19 15:00:36 -040023
24DEPS_TARGETS = $(addprefix $(MKBUILD)/.dep_, $(DEPS))
25
26Q=@
27
28$(MKBUILD):
29 $Qmkdir -p $(MKBUILD)
30
Mike Marchetti9cf41562018-10-01 12:37:59 -040031$(MKBUILD)/.dep_policy-module:
32 $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m POL -p policy-module > $@
33
garciadeblas3fad2ea2018-11-29 16:36:50 +010034$(MKBUILD)/.dep_lightui:
35 $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m LW-UI -p lightui > $@
36
Mike Marchetti13d76c82018-09-19 15:00:36 -040037$(MKBUILD)/.dep_%:
Mike Marchettif3186d52018-09-19 17:04:53 -040038 $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m $* > $@
Mike Marchetti13d76c82018-09-19 15:00:36 -040039
40build: $(MKBUILD) $(DEPS_TARGETS)
garciadeblas0d45bc82018-11-19 14:25:13 +010041 $Qdocker build -t opensourcemano/$(LOWER_MDG):$(TAG) \
Mike Marchetti13d76c82018-09-19 15:00:36 -040042 --build-arg RELEASE=$(RELEASE) \
43 --build-arg REPOSITORY=$(REPOSITORY) \
44 --build-arg REPOSITORY_KEY=$(REPOSITORY_KEY) \
45 --build-arg REPOSITORY_BASE=$(REPOSITORY_BASE) \
46 --build-arg MON_VERSION==$(shell cat $(MKBUILD)/.dep_MON) \
47 --build-arg IM_VERSION==$(shell cat $(MKBUILD)/.dep_IM) \
48 --build-arg RO_VERSION==$(shell cat $(MKBUILD)/.dep_RO) \
49 --build-arg LCM_VERSION==$(shell cat $(MKBUILD)/.dep_LCM) \
50 --build-arg COMMON_VERSION==$(shell cat $(MKBUILD)/.dep_common) \
51 --build-arg OSMCLIENT_VERSION==$(shell cat $(MKBUILD)/.dep_osmclient) \
52 --build-arg NBI_VERSION==$(shell cat $(MKBUILD)/.dep_NBI) \
Mike Marchetti9cf41562018-10-01 12:37:59 -040053 --build-arg POL_VERSION==$(shell cat $(MKBUILD)/.dep_policy-module) \
Mike Marchettie31371a2018-09-21 16:56:54 -040054 --build-arg DEVOPS_VERSION==$(shell cat $(MKBUILD)/.dep_devops) \
Michael Marchetti9e7ed042018-10-30 00:23:37 +010055 --build-arg N2VC_VERSION==$(shell cat $(MKBUILD)/.dep_N2VC) \
garciadeblas3fad2ea2018-11-29 16:36:50 +010056 --build-arg LWUI_VERSION==$(shell cat $(MKBUILD)/.dep_lightui) \
Mike Marchetti13d76c82018-09-19 15:00:36 -040057 $(DOCKER_ARGS) .
58
59clean:
60 rm -f $(MKBUILD)/.dep*
61
62tag:
garciadeblas0d45bc82018-11-19 14:25:13 +010063 docker tag opensourcemano/$(CONTAINER_NAME):$(INPUT_TAG) opensourcemano/$(LOWER_MDG):$(TAG)
Mike Marchettic21682c2018-10-15 09:40:57 -040064
65push: tag
66 docker push opensourcemano/$(LOWER_MDG):$(TAG)