4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 TOPDIR=$(shell readlink -f .|sed -e 's/\/docker\/.*//')
17 MKINCLUDE=$(TOPDIR)/docker/mk
18 MKBUILD=$(TOPDIR)/docker/build
24 REPOSITORY_BASE ?= http://osm-download.etsi.org/repository/osm/debian
25 RELEASE ?= ReleaseNINE-daily
26 REPOSITORY_KEY ?= OSM%20ETSI%20Release%20Key.gpg
28 NO_CACHE ?= --no-cache
31 LOWER_MDG = $(shell echo $(MDG) | tr '[:upper:]' '[:lower:]')
33 CONTAINER_NAME ?= $(LOWER_MDG)
36 DOCKER_ARGS = $(CMD_DOCKER_ARGS)
38 DEPS := MON IM LCM RO common osmclient devops NBI policy-module Keystone N2VC lightui ngui PLA tests Prometheus
40 DEPS_TARGETS = $(addprefix $(MKBUILD)/.dep_, $(DEPS))
47 $(MKBUILD)/.dep_policy-module:
48 $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m POL -p policy-module > $@
50 $(MKBUILD)/.dep_lightui:
51 $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m LW-UI -p lightui > $@
54 $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m NG-UI -p ngui > $@
57 $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m $* > $@
59 build: $(MKBUILD) $(DEPS_TARGETS)
60 $Qdocker build -t opensourcemano/$(LOWER_MDG):$(TAG) \
61 --build-arg RELEASE=$(RELEASE) \
62 --build-arg REPOSITORY=$(REPOSITORY) \
63 --build-arg REPOSITORY_KEY=$(REPOSITORY_KEY) \
64 --build-arg REPOSITORY_BASE=$(REPOSITORY_BASE) \
65 --build-arg MON_VERSION==$(shell cat $(MKBUILD)/.dep_MON) \
66 --build-arg IM_VERSION==$(shell cat $(MKBUILD)/.dep_IM) \
67 --build-arg RO_VERSION==$(shell cat $(MKBUILD)/.dep_RO) \
68 --build-arg LCM_VERSION==$(shell cat $(MKBUILD)/.dep_LCM) \
69 --build-arg COMMON_VERSION==$(shell cat $(MKBUILD)/.dep_common) \
70 --build-arg OSMCLIENT_VERSION==$(shell cat $(MKBUILD)/.dep_osmclient) \
71 --build-arg NBI_VERSION==$(shell cat $(MKBUILD)/.dep_NBI) \
72 --build-arg POL_VERSION==$(shell cat $(MKBUILD)/.dep_policy-module) \
73 --build-arg PLA_VERSION==$(shell cat $(MKBUILD)/.dep_PLA) \
74 --build-arg DEVOPS_VERSION==$(shell cat $(MKBUILD)/.dep_devops) \
75 --build-arg N2VC_VERSION==$(shell cat $(MKBUILD)/.dep_N2VC) \
76 --build-arg NGUI_VERSION==$(shell cat $(MKBUILD)/.dep_ngui) \
77 --build-arg NGSA_VERSION==$(shell cat $(MKBUILD)/.dep_ngsa) \
78 --build-arg TESTS_VERSION==$(shell cat $(MKBUILD)/.dep_tests) \
79 --build-arg CACHE_DATE==$(shell date -uI) \
83 rm -f $(MKBUILD)/.dep*
86 docker tag opensourcemano/$(CONTAINER_NAME):$(INPUT_TAG) $(DOCKER_REGISTRY)opensourcemano/$(LOWER_MDG):$(TAG)
89 docker push $(DOCKER_REGISTRY)opensourcemano/$(LOWER_MDG):$(TAG)