blob: 4105295ed91a230553567f3c5bebb37c63bd7219 [file] [log] [blame]
garciadeblas9887bb42020-06-08 09:55:28 +00001#
2# Copyright 2020 ETSI
3#
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
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
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.
15#
Mike Marchetti13d76c82018-09-19 15:00:36 -040016TOPDIR=$(shell readlink -f .|sed -e 's/\/docker\/.*//')
17MKINCLUDE=$(TOPDIR)/docker/mk
18MKBUILD=$(TOPDIR)/docker/build
19
20all: build
21
garciadeblasa5e66072019-05-29 12:23:22 +020022TAG ?= 6
Mike Marchetti13d76c82018-09-19 15:00:36 -040023
24REPOSITORY_BASE ?= http://osm-download.etsi.org/repository/osm/debian
garciadeblasfa81f282020-12-15 00:32:13 +000025RELEASE ?= ReleaseNINE-daily
Mike Marchetti13d76c82018-09-19 15:00:36 -040026REPOSITORY_KEY ?= OSM%20ETSI%20Release%20Key.gpg
27REPOSITORY ?= testing
28NO_CACHE ?= --no-cache
beierlm7b0acc02020-11-19 11:39:36 -050029DOCKER_REGISTRY ?= ""
Mike Marchetti13d76c82018-09-19 15:00:36 -040030
31LOWER_MDG = $(shell echo $(MDG) | tr '[:upper:]' '[:lower:]')
32
Mike Marchetti9cf41562018-10-01 12:37:59 -040033CONTAINER_NAME ?= $(LOWER_MDG)
34
Mike Marchetti13d76c82018-09-19 15:00:36 -040035CMD_DOCKER_ARGS ?= -q
36DOCKER_ARGS = $(CMD_DOCKER_ARGS)
37
beierlmaf26f652020-10-16 21:47:19 +020038DEPS := MON IM LCM RO common osmclient devops NBI policy-module Keystone N2VC lightui ngui PLA tests
Mike Marchetti13d76c82018-09-19 15:00:36 -040039
40DEPS_TARGETS = $(addprefix $(MKBUILD)/.dep_, $(DEPS))
41
42Q=@
43
44$(MKBUILD):
45 $Qmkdir -p $(MKBUILD)
46
Mike Marchetti9cf41562018-10-01 12:37:59 -040047$(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 > $@
49
beierlmaf26f652020-10-16 21:47:19 +020050$(MKBUILD)/.dep_lightui:
51 $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m LW-UI -p lightui > $@
garciadeblas3fad2ea2018-11-29 16:36:50 +010052
Felipe Vicensdb892452020-06-22 21:34:01 +020053$(MKBUILD)/.dep_ngui:
54 $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m NG-UI -p ngui > $@
55
Mike Marchetti13d76c82018-09-19 15:00:36 -040056$(MKBUILD)/.dep_%:
Mike Marchettif3186d52018-09-19 17:04:53 -040057 $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m $* > $@
Mike Marchetti13d76c82018-09-19 15:00:36 -040058
59build: $(MKBUILD) $(DEPS_TARGETS)
garciadeblas0d45bc82018-11-19 14:25:13 +010060 $Qdocker build -t opensourcemano/$(LOWER_MDG):$(TAG) \
Mike Marchetti13d76c82018-09-19 15:00:36 -040061 --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) \
Mike Marchetti9cf41562018-10-01 12:37:59 -040072 --build-arg POL_VERSION==$(shell cat $(MKBUILD)/.dep_policy-module) \
garciadeblasc16af7f2020-05-08 14:24:43 +000073 --build-arg PLA_VERSION==$(shell cat $(MKBUILD)/.dep_PLA) \
Mike Marchettie31371a2018-09-21 16:56:54 -040074 --build-arg DEVOPS_VERSION==$(shell cat $(MKBUILD)/.dep_devops) \
Michael Marchetti9e7ed042018-10-30 00:23:37 +010075 --build-arg N2VC_VERSION==$(shell cat $(MKBUILD)/.dep_N2VC) \
garciadeblas3fad2ea2018-11-29 16:36:50 +010076 --build-arg LWUI_VERSION==$(shell cat $(MKBUILD)/.dep_lightui) \
Felipe Vicensdb892452020-06-22 21:34:01 +020077 --build-arg NGUI_VERSION==$(shell cat $(MKBUILD)/.dep_ngui) \
Felipe Vicens7334f682020-06-24 15:59:59 +020078 --build-arg TESTS_VERSION==$(shell cat $(MKBUILD)/.dep_tests) \
Mike Marchetti13d76c82018-09-19 15:00:36 -040079 $(DOCKER_ARGS) .
80
81clean:
82 rm -f $(MKBUILD)/.dep*
83
84tag:
beierlm7b0acc02020-11-19 11:39:36 -050085 docker tag opensourcemano/$(CONTAINER_NAME):$(INPUT_TAG) $(DOCKER_REGISTRY)opensourcemano/$(LOWER_MDG):$(TAG)
Mike Marchettic21682c2018-10-15 09:40:57 -040086
87push: tag
beierlm7b0acc02020-11-19 11:39:36 -050088 docker push $(DOCKER_REGISTRY)opensourcemano/$(LOWER_MDG):$(TAG)