| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 1 | # |
| 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 Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 16 | TOPDIR=$(shell readlink -f .|sed -e 's/\/docker\/.*//') |
| 17 | MKINCLUDE=$(TOPDIR)/docker/mk |
| 18 | MKBUILD=$(TOPDIR)/docker/build |
| 19 | |
| 20 | all: build |
| 21 | |
| garciadeblas | a5e6607 | 2019-05-29 12:23:22 +0200 | [diff] [blame] | 22 | TAG ?= 6 |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 23 | |
| 24 | REPOSITORY_BASE ?= http://osm-download.etsi.org/repository/osm/debian |
| beierlm | a4a37f7 | 2020-06-26 12:55:01 -0400 | [diff] [blame^] | 25 | RELEASE ?= ReleaseEIGHT-daily |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 26 | REPOSITORY_KEY ?= OSM%20ETSI%20Release%20Key.gpg |
| 27 | REPOSITORY ?= testing |
| 28 | NO_CACHE ?= --no-cache |
| 29 | |
| 30 | LOWER_MDG = $(shell echo $(MDG) | tr '[:upper:]' '[:lower:]') |
| 31 | |
| Mike Marchetti | 9cf4156 | 2018-10-01 12:37:59 -0400 | [diff] [blame] | 32 | CONTAINER_NAME ?= $(LOWER_MDG) |
| 33 | |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 34 | CMD_DOCKER_ARGS ?= -q |
| 35 | DOCKER_ARGS = $(CMD_DOCKER_ARGS) |
| 36 | |
| Felipe Vicens | 7334f68 | 2020-06-24 15:59:59 +0200 | [diff] [blame] | 37 | DEPS := MON IM LCM RO common osmclient devops NBI policy-module Keystone N2VC lightui ngui PLA tests |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 38 | |
| 39 | DEPS_TARGETS = $(addprefix $(MKBUILD)/.dep_, $(DEPS)) |
| 40 | |
| 41 | Q=@ |
| 42 | |
| 43 | $(MKBUILD): |
| 44 | $Qmkdir -p $(MKBUILD) |
| 45 | |
| Mike Marchetti | 9cf4156 | 2018-10-01 12:37:59 -0400 | [diff] [blame] | 46 | $(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 | |
| garciadeblas | 3fad2ea | 2018-11-29 16:36:50 +0100 | [diff] [blame] | 49 | $(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 | |
| Felipe Vicens | db89245 | 2020-06-22 21:34:01 +0200 | [diff] [blame] | 52 | $(MKBUILD)/.dep_ngui: |
| 53 | $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m NG-UI -p ngui > $@ |
| 54 | |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 55 | $(MKBUILD)/.dep_%: |
| Mike Marchetti | f3186d5 | 2018-09-19 17:04:53 -0400 | [diff] [blame] | 56 | $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m $* > $@ |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 57 | |
| 58 | build: $(MKBUILD) $(DEPS_TARGETS) |
| garciadeblas | 0d45bc8 | 2018-11-19 14:25:13 +0100 | [diff] [blame] | 59 | $Qdocker build -t opensourcemano/$(LOWER_MDG):$(TAG) \ |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 60 | --build-arg RELEASE=$(RELEASE) \ |
| 61 | --build-arg REPOSITORY=$(REPOSITORY) \ |
| 62 | --build-arg REPOSITORY_KEY=$(REPOSITORY_KEY) \ |
| 63 | --build-arg REPOSITORY_BASE=$(REPOSITORY_BASE) \ |
| 64 | --build-arg MON_VERSION==$(shell cat $(MKBUILD)/.dep_MON) \ |
| 65 | --build-arg IM_VERSION==$(shell cat $(MKBUILD)/.dep_IM) \ |
| 66 | --build-arg RO_VERSION==$(shell cat $(MKBUILD)/.dep_RO) \ |
| 67 | --build-arg LCM_VERSION==$(shell cat $(MKBUILD)/.dep_LCM) \ |
| 68 | --build-arg COMMON_VERSION==$(shell cat $(MKBUILD)/.dep_common) \ |
| 69 | --build-arg OSMCLIENT_VERSION==$(shell cat $(MKBUILD)/.dep_osmclient) \ |
| 70 | --build-arg NBI_VERSION==$(shell cat $(MKBUILD)/.dep_NBI) \ |
| Mike Marchetti | 9cf4156 | 2018-10-01 12:37:59 -0400 | [diff] [blame] | 71 | --build-arg POL_VERSION==$(shell cat $(MKBUILD)/.dep_policy-module) \ |
| garciadeblas | c16af7f | 2020-05-08 14:24:43 +0000 | [diff] [blame] | 72 | --build-arg PLA_VERSION==$(shell cat $(MKBUILD)/.dep_PLA) \ |
| Mike Marchetti | e31371a | 2018-09-21 16:56:54 -0400 | [diff] [blame] | 73 | --build-arg DEVOPS_VERSION==$(shell cat $(MKBUILD)/.dep_devops) \ |
| Michael Marchetti | 9e7ed04 | 2018-10-30 00:23:37 +0100 | [diff] [blame] | 74 | --build-arg N2VC_VERSION==$(shell cat $(MKBUILD)/.dep_N2VC) \ |
| garciadeblas | 3fad2ea | 2018-11-29 16:36:50 +0100 | [diff] [blame] | 75 | --build-arg LWUI_VERSION==$(shell cat $(MKBUILD)/.dep_lightui) \ |
| Felipe Vicens | db89245 | 2020-06-22 21:34:01 +0200 | [diff] [blame] | 76 | --build-arg NGUI_VERSION==$(shell cat $(MKBUILD)/.dep_ngui) \ |
| Felipe Vicens | 7334f68 | 2020-06-24 15:59:59 +0200 | [diff] [blame] | 77 | --build-arg TESTS_VERSION==$(shell cat $(MKBUILD)/.dep_tests) \ |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 78 | $(DOCKER_ARGS) . |
| 79 | |
| 80 | clean: |
| 81 | rm -f $(MKBUILD)/.dep* |
| 82 | |
| 83 | tag: |
| garciadeblas | 0d45bc8 | 2018-11-19 14:25:13 +0100 | [diff] [blame] | 84 | docker tag opensourcemano/$(CONTAINER_NAME):$(INPUT_TAG) opensourcemano/$(LOWER_MDG):$(TAG) |
| Mike Marchetti | c21682c | 2018-10-15 09:40:57 -0400 | [diff] [blame] | 85 | |
| 86 | push: tag |
| 87 | docker push opensourcemano/$(LOWER_MDG):$(TAG) |