remove interative mode for running systest
[osm/devops.git] / docker / mk / Makefile.include
1 TOPDIR=$(shell readlink -f .|sed -e 's/\/docker\/.*//')
2 MKINCLUDE=$(TOPDIR)/docker/mk
3 MKBUILD=$(TOPDIR)/docker/build
4
5 all: build
6
7 TAG ?= latest
8
9 REPOSITORY_BASE ?= http://osm-download.etsi.org/repository/osm/debian
10 RELEASE         ?= ReleaseFOUR-daily
11 REPOSITORY_KEY  ?= OSM%20ETSI%20Release%20Key.gpg
12 REPOSITORY      ?= testing
13 NO_CACHE        ?= --no-cache
14
15 LOWER_MDG = $(shell echo $(MDG) | tr '[:upper:]' '[:lower:]')
16
17 CMD_DOCKER_ARGS ?= -q
18 DOCKER_ARGS     = $(CMD_DOCKER_ARGS)
19
20 DEPS := MON IM LCM RO common osmclient devops NBI POL
21
22 DEPS_TARGETS = $(addprefix $(MKBUILD)/.dep_, $(DEPS))
23
24 Q=@
25
26 $(MKBUILD):
27         $Qmkdir -p $(MKBUILD)
28
29 $(MKBUILD)/.dep_%:
30         $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m $* > $@
31
32 build: $(MKBUILD) $(DEPS_TARGETS)
33         $Qdocker build -t osm/$(LOWER_MDG):$(TAG) \
34                    --build-arg RELEASE=$(RELEASE) \
35                    --build-arg REPOSITORY=$(REPOSITORY) \
36                    --build-arg REPOSITORY_KEY=$(REPOSITORY_KEY) \
37                    --build-arg REPOSITORY_BASE=$(REPOSITORY_BASE) \
38                    --build-arg MON_VERSION==$(shell cat $(MKBUILD)/.dep_MON) \
39                    --build-arg IM_VERSION==$(shell cat $(MKBUILD)/.dep_IM) \
40                    --build-arg RO_VERSION==$(shell cat $(MKBUILD)/.dep_RO) \
41                    --build-arg LCM_VERSION==$(shell cat $(MKBUILD)/.dep_LCM) \
42                    --build-arg COMMON_VERSION==$(shell cat $(MKBUILD)/.dep_common) \
43                    --build-arg OSMCLIENT_VERSION==$(shell cat $(MKBUILD)/.dep_osmclient) \
44                    --build-arg NBI_VERSION==$(shell cat $(MKBUILD)/.dep_NBI) \
45                    --build-arg POL_VERSION==$(shell cat $(MKBUILD)/.dep_POL) \
46                    $(DOCKER_ARGS) .
47
48 clean:
49         rm -f $(MKBUILD)/.dep*
50
51 tag:
52         docker tag osm/$(LOWER_MDG) osm/$(LOWER_MDG):$(TAG)