make/Makefile: allow overriding OSMO_TTCN3_BRANCH

Set the OSMO_TTCN3_BRANCH build argument from ttcn3-*/Dockerfile from
the environment variable of the same name, so it can be changed when
building the images with 'make' or './'.

Dockerfiles that do not have a OSMO_TCCN3_BRANCH build arg produce a
warning. But this is also the case with Dockerfiles that don't have an
USER build arg, and avoiding the warning would only be possible with a
much more complex patch.

Change-Id: If2c312ff9206d1613fc19f41bd088c9aad523684
This commit is contained in:
Oliver Smith 2019-03-04 12:49:36 +01:00
parent 618c7abc72
commit ee386a6731
2 changed files with 6 additions and 1 deletions

View File

@ -18,6 +18,9 @@ Environment variables:
* `IMAGE_SUFFIX`: the version of the Osmocom stack to run the testsuite
against. Default is `master`, set this to `latest` to test the last
stable releases.
* `OSMO_TTCN3_BRANCH`: [osmo-ttcn3-hacks.git](
branch, which will be used when building a `ttcn3-*` docker image.
Defaults to `master`.
* `NO_DOCKER_IMAGE_BUILD`: when set to `1`, it won't try to update the
containers (see "caching" below)

View File

@ -16,6 +16,7 @@
NAME?=$(shell basename $(CURDIR))
RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support
@ -39,7 +40,8 @@ post-push:
docker-build: .release
docker build --build-arg USER=$(USERNAME) -t $(IMAGE):latest .
docker build --build-arg USER=$(USERNAME) --build-arg OSMO_TTCN3_BRANCH=$(OSMO_TTCN3_BRANCH) \
-t $(IMAGE):latest .
@DOCKER_MAJOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f1) ; \
DOCKER_MINOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f2) ; \