blob: 1369a6d42df036d19f89c6e5dbff0acd8cad1102 [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
25RELEASE ?= ReleaseFOUR-daily
26REPOSITORY_KEY ?= OSM%20ETSI%20Release%20Key.gpg
27REPOSITORY ?= testing
28NO_CACHE ?= --no-cache
29
30LOWER_MDG = $(shell echo $(MDG) | tr '[:upper:]' '[:lower:]')
31
Mike Marchetti9cf41562018-10-01 12:37:59 -040032CONTAINER_NAME ?= $(LOWER_MDG)
33
Mike Marchetti13d76c82018-09-19 15:00:36 -040034CMD_DOCKER_ARGS ?= -q
35DOCKER_ARGS = $(CMD_DOCKER_ARGS)
36
garciadeblasc16af7f2020-05-08 14:24:43 +000037DEPS := MON IM LCM RO common osmclient devops NBI policy-module Keystone N2VC lightui NG-UI PLA
Mike Marchetti13d76c82018-09-19 15:00:36 -040038
39DEPS_TARGETS = $(addprefix $(MKBUILD)/.dep_, $(DEPS))
40
41Q=@
42
43$(MKBUILD):
44 $Qmkdir -p $(MKBUILD)
45
Mike Marchetti9cf41562018-10-01 12:37:59 -040046$(MKBUILD)/.dep_policy-module:
47 $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m POL -p policy-module > $@
48
garciadeblas3fad2ea2018-11-29 16:36:50 +010049$(MKBUILD)/.dep_lightui:
50 $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m LW-UI -p lightui > $@
51
Mike Marchetti13d76c82018-09-19 15:00:36 -040052$(MKBUILD)/.dep_%:
Mike Marchettif3186d52018-09-19 17:04:53 -040053 $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m $* > $@
Mike Marchetti13d76c82018-09-19 15:00:36 -040054
55build: $(MKBUILD) $(DEPS_TARGETS)
garciadeblas0d45bc82018-11-19 14:25:13 +010056 $Qdocker build -t opensourcemano/$(LOWER_MDG):$(TAG) \
Mike Marchetti13d76c82018-09-19 15:00:36 -040057 --build-arg RELEASE=$(RELEASE) \
58 --build-arg REPOSITORY=$(REPOSITORY) \
59 --build-arg REPOSITORY_KEY=$(REPOSITORY_KEY) \
60 --build-arg REPOSITORY_BASE=$(REPOSITORY_BASE) \
61 --build-arg MON_VERSION==$(shell cat $(MKBUILD)/.dep_MON) \
62 --build-arg IM_VERSION==$(shell cat $(MKBUILD)/.dep_IM) \
63 --build-arg RO_VERSION==$(shell cat $(MKBUILD)/.dep_RO) \
64 --build-arg LCM_VERSION==$(shell cat $(MKBUILD)/.dep_LCM) \
65 --build-arg COMMON_VERSION==$(shell cat $(MKBUILD)/.dep_common) \
66 --build-arg OSMCLIENT_VERSION==$(shell cat $(MKBUILD)/.dep_osmclient) \
67 --build-arg NBI_VERSION==$(shell cat $(MKBUILD)/.dep_NBI) \
Mike Marchetti9cf41562018-10-01 12:37:59 -040068 --build-arg POL_VERSION==$(shell cat $(MKBUILD)/.dep_policy-module) \
garciadeblasc16af7f2020-05-08 14:24:43 +000069 --build-arg PLA_VERSION==$(shell cat $(MKBUILD)/.dep_PLA) \
Mike Marchettie31371a2018-09-21 16:56:54 -040070 --build-arg DEVOPS_VERSION==$(shell cat $(MKBUILD)/.dep_devops) \
Michael Marchetti9e7ed042018-10-30 00:23:37 +010071 --build-arg N2VC_VERSION==$(shell cat $(MKBUILD)/.dep_N2VC) \
garciadeblas3fad2ea2018-11-29 16:36:50 +010072 --build-arg LWUI_VERSION==$(shell cat $(MKBUILD)/.dep_lightui) \
garciadeblas9887bb42020-06-08 09:55:28 +000073 --build-arg NGUI_VERSION==$(shell cat $(MKBUILD)/.dep_NG-UI) \
Mike Marchetti13d76c82018-09-19 15:00:36 -040074 $(DOCKER_ARGS) .
75
76clean:
77 rm -f $(MKBUILD)/.dep*
78
79tag:
garciadeblas0d45bc82018-11-19 14:25:13 +010080 docker tag opensourcemano/$(CONTAINER_NAME):$(INPUT_TAG) opensourcemano/$(LOWER_MDG):$(TAG)
Mike Marchettic21682c2018-10-15 09:40:57 -040081
82push: tag
83 docker push opensourcemano/$(LOWER_MDG):$(TAG)