X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fdevops.git;a=blobdiff_plain;f=docker%2Fmk%2FMakefile.include;h=995cbdf214b91d292f36c527662c04089cad3d17;hp=54ef41a036adae69a4d577dffa5c0c3b78c17ec2;hb=fd94ec1d6b3780babaca2724a48f9dba12756cda;hpb=e193dfd4b1e2f8c530eaf9be6423942a68aec07e diff --git a/docker/mk/Makefile.include b/docker/mk/Makefile.include index 54ef41a0..995cbdf2 100644 --- a/docker/mk/Makefile.include +++ b/docker/mk/Makefile.include @@ -1,23 +1,41 @@ +# +# Copyright 2020 ETSI +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# TOPDIR=$(shell readlink -f .|sed -e 's/\/docker\/.*//') MKINCLUDE=$(TOPDIR)/docker/mk MKBUILD=$(TOPDIR)/docker/build all: build -TAG ?= latest +TAG ?= 6 REPOSITORY_BASE ?= http://osm-download.etsi.org/repository/osm/debian -RELEASE ?= ReleaseFOUR-daily +RELEASE ?= ReleaseEIGHT-daily REPOSITORY_KEY ?= OSM%20ETSI%20Release%20Key.gpg REPOSITORY ?= testing NO_CACHE ?= --no-cache +DOCKER_REGISTRY ?= "" LOWER_MDG = $(shell echo $(MDG) | tr '[:upper:]' '[:lower:]') +CONTAINER_NAME ?= $(LOWER_MDG) + CMD_DOCKER_ARGS ?= -q DOCKER_ARGS = $(CMD_DOCKER_ARGS) -DEPS := MON IM LCM RO common osmclient devops NBI POL Keystone +DEPS := MON IM LCM RO common osmclient devops NBI policy-module Keystone N2VC lightui ngui PLA tests DEPS_TARGETS = $(addprefix $(MKBUILD)/.dep_, $(DEPS)) @@ -26,11 +44,20 @@ Q=@ $(MKBUILD): $Qmkdir -p $(MKBUILD) +$(MKBUILD)/.dep_policy-module: + $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m POL -p policy-module > $@ + +$(MKBUILD)/.dep_lightui: + $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m LW-UI -p lightui > $@ + +$(MKBUILD)/.dep_ngui: + $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m NG-UI -p ngui > $@ + $(MKBUILD)/.dep_%: $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m $* > $@ build: $(MKBUILD) $(DEPS_TARGETS) - $Qdocker build -t osm/$(LOWER_MDG):$(TAG) \ + $Qdocker build -t opensourcemano/$(LOWER_MDG):$(TAG) \ --build-arg RELEASE=$(RELEASE) \ --build-arg REPOSITORY=$(REPOSITORY) \ --build-arg REPOSITORY_KEY=$(REPOSITORY_KEY) \ @@ -42,12 +69,20 @@ build: $(MKBUILD) $(DEPS_TARGETS) --build-arg COMMON_VERSION==$(shell cat $(MKBUILD)/.dep_common) \ --build-arg OSMCLIENT_VERSION==$(shell cat $(MKBUILD)/.dep_osmclient) \ --build-arg NBI_VERSION==$(shell cat $(MKBUILD)/.dep_NBI) \ - --build-arg POL_VERSION==$(shell cat $(MKBUILD)/.dep_POL) \ + --build-arg POL_VERSION==$(shell cat $(MKBUILD)/.dep_policy-module) \ + --build-arg PLA_VERSION==$(shell cat $(MKBUILD)/.dep_PLA) \ --build-arg DEVOPS_VERSION==$(shell cat $(MKBUILD)/.dep_devops) \ + --build-arg N2VC_VERSION==$(shell cat $(MKBUILD)/.dep_N2VC) \ + --build-arg LWUI_VERSION==$(shell cat $(MKBUILD)/.dep_lightui) \ + --build-arg NGUI_VERSION==$(shell cat $(MKBUILD)/.dep_ngui) \ + --build-arg TESTS_VERSION==$(shell cat $(MKBUILD)/.dep_tests) \ $(DOCKER_ARGS) . clean: rm -f $(MKBUILD)/.dep* tag: - docker tag osm/$(LOWER_MDG) osm/$(LOWER_MDG):$(TAG) + docker tag opensourcemano/$(CONTAINER_NAME):$(INPUT_TAG) $(DOCKER_REGISTRY)opensourcemano/$(LOWER_MDG):$(TAG) + +push: tag + docker push $(DOCKER_REGISTRY)opensourcemano/$(LOWER_MDG):$(TAG)