From b59a9ed8d4d00eab4193caa46a1f24d280478b96 Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Thu, 25 Apr 2019 13:56:14 +0200 Subject: [PATCH] Add OSMO_*_BRANCH environment variables for build args Previously we could only set OSMO_TTCN3_BRANCH as environment variable to build a test other than master. This patch adds environment variables for all osmo-*-master images which allow docker tests to be executed for an arbitrary commit. The origin/ prefix from the git checkout command is removed so the *_BRANCH variable doesn't have to contain branch names, but van also contain arbitrary commits. This shouldn't have any adverse effect as we only have one remote in the checkout. Change-Id: If3bc5fae07cf63c4fef68306be4c4328660bc869 --- make/Makefile | 24 ++++++++++++++++++++++++ osmo-bsc-master/Dockerfile | 2 +- osmo-bts-master/Dockerfile | 2 +- osmo-ggsn-master/Dockerfile | 2 +- osmo-hlr-master/Dockerfile | 2 +- osmo-hnbgw-master/Dockerfile | 2 +- osmo-mgw-master/Dockerfile | 2 +- osmo-msc-master/Dockerfile | 2 +- osmo-nitb-master/Dockerfile | 7 +++++-- osmo-pcu-master/Dockerfile | 2 +- osmo-sgsn-master/Dockerfile | 2 +- osmo-sip-master/Dockerfile | 2 +- osmo-stp-master/Dockerfile | 2 +- 13 files changed, 40 insertions(+), 13 deletions(-) diff --git a/make/Makefile b/make/Makefile index 7dfa795f..000db25e 100644 --- a/make/Makefile +++ b/make/Makefile @@ -17,6 +17,18 @@ REGISTRY_HOST?=docker.io USERNAME?=$(USER) NAME?=$(shell basename $(CURDIR)) OSMO_TTCN3_BRANCH?=master +OSMO_BSC_BRANCH?=master +OSMO_BTS_BRANCH?=master +OSMO_GGSN_BRANCH?=master +OSMO_HLR_BRANCH?=master +OSMO_IUH_BRANCH?=master +OSMO_MGW_BRANCH?=master +OSMO_MSC_BRANCH?=master +OSMO_NITB_BRANCH?=master +OSMO_PCU_BRANCH?=master +OSMO_SGSN_BRANCH?=master +OSMO_SIP_BRANCH?=master +OSMO_STP_BRANCH?=master PULL?= RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support @@ -42,6 +54,18 @@ post-push: docker-build: .release docker build --build-arg USER=$(USERNAME) --build-arg OSMO_TTCN3_BRANCH=$(OSMO_TTCN3_BRANCH) \ + --build-arg OSMO_BSC_BRANCH=$(OSMO_BSC_BRANCH) \ + --build-arg OSMO_BTS_BRANCH=$(OSMO_BTS_BRANCH) \ + --build-arg OSMO_GGSN_BRANCH=$(OSMO_GGSN_BRANCH) \ + --build-arg OSMO_HLR_BRANCH=$(OSMO_HLR_BRANCH) \ + --build-arg OSMO_IUH_BRANCH=$(OSMO_IUH_BRANCH) \ + --build-arg OSMO_MGW_BRANCH=$(OSMO_MGW_BRANCH) \ + --build-arg OSMO_MSC_BRANCH=$(OSMO_MSC_BRANCH) \ + --build-arg OSMO_NITB_BRANCH=$(OSMO_NITB_BRANCH) \ + --build-arg OSMO_PCU_BRANCH=$(OSMO_PCU_BRANCH) \ + --build-arg OSMO_SGSN_BRANCH=$(OSMO_SGSN_BRANCH) \ + --build-arg OSMO_SIP_BRANCH=$(OSMO_SIP_BRANCH) \ + --build-arg OSMO_STP_BRANCH=$(OSMO_STP_BRANCH) \ $(PULL) -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) ; \ diff --git a/osmo-bsc-master/Dockerfile b/osmo-bsc-master/Dockerfile index 61ac8e42..bcd05734 100644 --- a/osmo-bsc-master/Dockerfile +++ b/osmo-bsc-master/Dockerfile @@ -32,7 +32,7 @@ RUN git clone git://git.osmocom.org/osmo-bsc.git ADD http://git.osmocom.org/osmo-bsc/patch?h=$OSMO_BSC_BRANCH /tmp/commit-osmo-bsc RUN cd osmo-bsc && \ - git fetch && git checkout -f -B $OSMO_BSC_BRANCH origin/$OSMO_BSC_BRANCH && \ + git fetch && git checkout -f -B $OSMO_BSC_BRANCH $OSMO_BSC_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-bts-master/Dockerfile b/osmo-bts-master/Dockerfile index be580818..f4ddf3ac 100644 --- a/osmo-bts-master/Dockerfile +++ b/osmo-bts-master/Dockerfile @@ -33,7 +33,7 @@ RUN git clone git://git.osmocom.org/osmo-bts.git ADD http://git.osmocom.org/osmo-bts/patch?h=$OSMO_BTS_BRANCH /tmp/commit-osmo-bts RUN cd osmo-bts && \ - git fetch && git checkout -f -B $OSMO_BTS_BRANCH origin/$OSMO_BTS_BRANCH && \ + git fetch && git checkout -f -B $OSMO_BTS_BRANCH $OSMO_BTS_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure --enable-trx && \ diff --git a/osmo-ggsn-master/Dockerfile b/osmo-ggsn-master/Dockerfile index ca4f1118..cf84d023 100644 --- a/osmo-ggsn-master/Dockerfile +++ b/osmo-ggsn-master/Dockerfile @@ -25,7 +25,7 @@ ARG OSMO_GGSN_BRANCH="master" RUN git clone git://git.osmocom.org/osmo-ggsn.git ADD http://git.osmocom.org/osmo-ggsn/patch/?h=$OSMO_GGSN_BRANCH /tmp/commit RUN cd osmo-ggsn && \ - git fetch && git checkout -f -B $OSMO_GGSN_BRANCH origin/$OSMO_GGSN_BRANCH && \ + git fetch && git checkout -f -B $OSMO_GGSN_BRANCH $OSMO_GGSN_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-hlr-master/Dockerfile b/osmo-hlr-master/Dockerfile index 75f29d9f..2da7c080 100644 --- a/osmo-hlr-master/Dockerfile +++ b/osmo-hlr-master/Dockerfile @@ -30,7 +30,7 @@ RUN git clone git://git.osmocom.org/osmo-hlr.git ADD http://git.osmocom.org/osmo-hlr/patch?h=$OSMO_HLR_BRANCH /tmp/commit-osmo-hlr RUN cd osmo-hlr && \ - git fetch && git checkout -f -B $OSMO_HLR_BRANCH origin/$OSMO_HLR_BRANCH && \ + git fetch && git checkout -f -B $OSMO_HLR_BRANCH $OSMO_HLR_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-hnbgw-master/Dockerfile b/osmo-hnbgw-master/Dockerfile index 4334e4f0..c89502b2 100644 --- a/osmo-hnbgw-master/Dockerfile +++ b/osmo-hnbgw-master/Dockerfile @@ -30,7 +30,7 @@ RUN git clone git://git.osmocom.org/osmo-iuh.git ADD http://git.osmocom.org/osmo-iuh/patch?h=$OSMO_IUH_BRANCH /tmp/commit-osmo-mgw RUN cd osmo-iuh && \ - git fetch && git checkout -f -B $OSMO_IUH_BRANCH origin/$OSMO_IUH_BRANCH && \ + git fetch && git checkout -f -B $OSMO_IUH_BRANCH $OSMO_IUH_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-mgw-master/Dockerfile b/osmo-mgw-master/Dockerfile index c333b1db..4c6d32a9 100644 --- a/osmo-mgw-master/Dockerfile +++ b/osmo-mgw-master/Dockerfile @@ -30,7 +30,7 @@ ADD http://git.osmocom.org/osmo-mgw/patch?h=$OSMO_MGW_BRANCH /tmp/commit-osmo-mg RUN cd osmo-mgw && \ - git fetch && git checkout -f -B $OSMO_MGW_BRANCH origin/$OSMO_MGW_BRANCH && \ + git fetch && git checkout -f -B $OSMO_MGW_BRANCH $OSMO_MGW_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-msc-master/Dockerfile b/osmo-msc-master/Dockerfile index 49be9c83..c8cfd625 100644 --- a/osmo-msc-master/Dockerfile +++ b/osmo-msc-master/Dockerfile @@ -37,7 +37,7 @@ RUN git clone git://git.osmocom.org/osmo-msc.git ADD http://git.osmocom.org/osmo-msc/patch?h=$OSMO_MSC_BRANCH /tmp/commit-osmo-msc RUN cd osmo-msc && \ - git fetch && git checkout -f -B $OSMO_MSC_BRANCH origin/$OSMO_MSC_BRANCH && \ + git fetch && git checkout -f -B $OSMO_MSC_BRANCH $OSMO_MSC_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure --enable-smpp --enable-iu && \ diff --git a/osmo-nitb-master/Dockerfile b/osmo-nitb-master/Dockerfile index bed228ec..d3774da1 100644 --- a/osmo-nitb-master/Dockerfile +++ b/osmo-nitb-master/Dockerfile @@ -25,11 +25,14 @@ RUN apt-get update && \ WORKDIR /tmp +ARG OSMO_NITB_BRANCH="master" + RUN git clone git://git.osmocom.org/openbsc.git -ADD http://git.osmocom.org/openbsc/patch /tmp/commit-openbsc +ADD http://git.osmocom.org/openbsc/patch?h=$OSMO_NITB_BRANCH /tmp/commit-openbsc RUN cd openbsc/openbsc && \ - git fetch && git checkout -f -B master origin/master && \ + git fetch && git checkout -f -B $OSMO_NITB_BRANCH $OSMO_NITB_BRANCH && \ + git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure --enable-nat --enable-osmo-bsc --enable-smpp && \ make -j8 install && \ diff --git a/osmo-pcu-master/Dockerfile b/osmo-pcu-master/Dockerfile index e33748a6..7a294a4d 100644 --- a/osmo-pcu-master/Dockerfile +++ b/osmo-pcu-master/Dockerfile @@ -28,7 +28,7 @@ RUN git clone git://git.osmocom.org/osmo-pcu.git ADD http://git.osmocom.org/osmo-pcu/patch?h=$OSMO_PCU_BRANCH /tmp/commit-osmo-pcu RUN cd osmo-pcu && \ - git fetch && git checkout -f -B $OSMO_PCU_BRANCH origin/$OSMO_PCU_BRANCH && \ + git fetch && git checkout -f -B $OSMO_PCU_BRANCH $OSMO_PCU_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure --enable-trx && \ diff --git a/osmo-sgsn-master/Dockerfile b/osmo-sgsn-master/Dockerfile index 87513cc1..c373564d 100644 --- a/osmo-sgsn-master/Dockerfile +++ b/osmo-sgsn-master/Dockerfile @@ -32,7 +32,7 @@ RUN git clone git://git.osmocom.org/osmo-sgsn.git ADD http://git.osmocom.org/osmo-sgsn/patch?h=$OSMO_SGSN_BRANCH /tmp/commit RUN cd osmo-sgsn && \ - git fetch && git checkout -f -B $OSMO_SGSN_BRANCH origin/$OSMO_SGSN_BRANCH && \ + git fetch && git checkout -f -B $OSMO_SGSN_BRANCH $OSMO_SGSN_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-sip-master/Dockerfile b/osmo-sip-master/Dockerfile index 58542211..258b1fe2 100644 --- a/osmo-sip-master/Dockerfile +++ b/osmo-sip-master/Dockerfile @@ -36,7 +36,7 @@ RUN git clone git://git.osmocom.org/osmo-sip-connector.git ADD http://git.osmocom.org/osmo-sip-connector/patch?h=$OSMO_SIP_BRANCH /tmp/commit-osmo-sip-connector RUN cd osmo-sip-connector && \ - git fetch && git checkout -f -B $OSMO_SIP_BRANCH origin/$OSMO_SIP_BRANCH && \ + git fetch && git checkout -f -B $OSMO_SIP_BRANCH $OSMO_SIP_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure --enable-smpp --enable-iu && \ diff --git a/osmo-stp-master/Dockerfile b/osmo-stp-master/Dockerfile index 7c59fb0c..0a62ed7b 100644 --- a/osmo-stp-master/Dockerfile +++ b/osmo-stp-master/Dockerfile @@ -26,7 +26,7 @@ ARG OSMO_STP_BRANCH="master" RUN git clone git://git.osmocom.org/libosmo-sccp.git ADD http://git.osmocom.org/libosmo-sccp/patch?h=$OSMO_STP_BRANCH /tmp/commit RUN cd libosmo-sccp && \ - git fetch && git checkout -f -B $OSMO_STP_BRANCH origin/$OSMO_STP_BRANCH && \ + git fetch && git checkout -f -B $OSMO_STP_BRANCH $OSMO_STP_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \