2017-08-19 17:31:49 +00:00
|
|
|
#
|
|
|
|
# Copyright 2015 Xebia Nederland B.V.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
2018-06-03 15:39:39 +00:00
|
|
|
REGISTRY_HOST?=docker.io
|
|
|
|
USERNAME?=$(USER)
|
2021-04-28 15:22:01 +00:00
|
|
|
UID=$(shell id -u)
|
2018-06-03 15:39:39 +00:00
|
|
|
NAME?=$(shell basename $(CURDIR))
|
2024-03-28 20:22:37 +00:00
|
|
|
ASTERISK_BRANCH?=sysmocom/master
|
2020-06-30 16:23:01 +00:00
|
|
|
LIBOSMOCORE_BRANCH?=master
|
2022-12-14 11:42:55 +00:00
|
|
|
LIBOSMOABIS_BRANCH?=master
|
|
|
|
LIBOSMONETIF_BRANCH?=master
|
2019-03-04 11:49:36 +00:00
|
|
|
OSMO_TTCN3_BRANCH?=master
|
2019-11-05 12:02:24 +00:00
|
|
|
OSMO_BB_BRANCH?=master
|
2019-04-25 11:56:14 +00:00
|
|
|
OSMO_BSC_BRANCH?=master
|
|
|
|
OSMO_BTS_BRANCH?=master
|
2022-06-16 14:26:42 +00:00
|
|
|
OSMO_CBC_BRANCH?=master
|
2023-08-23 14:33:28 +00:00
|
|
|
OSMO_DIA2GSUP_BRANCH?=master
|
2023-10-04 17:08:42 +00:00
|
|
|
OSMO_EPDG_BRANCH?=master
|
2021-02-02 17:39:02 +00:00
|
|
|
OSMO_GBPROXY_BRANCH?=master
|
2019-04-25 11:56:14 +00:00
|
|
|
OSMO_GGSN_BRANCH?=master
|
2020-01-30 15:29:08 +00:00
|
|
|
OSMO_GSM_TESTER_BRANCH?=master
|
2019-04-25 11:56:14 +00:00
|
|
|
OSMO_HLR_BRANCH?=master
|
2022-01-05 11:44:14 +00:00
|
|
|
OSMO_HNBGW_BRANCH?=master
|
2021-10-28 19:05:06 +00:00
|
|
|
OSMO_HNODEB_BRANCH?=master
|
2019-04-25 11:56:14 +00:00
|
|
|
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
|
2022-04-11 13:51:11 +00:00
|
|
|
OSMO_UECUPS_BRANCH?=master
|
2022-02-03 17:53:52 +00:00
|
|
|
OPEN5GS_BRANCH?=main
|
asterisk-master: Use pjproject from external git repo
By default, asterisk.git build system will fetch pjproject tarball from
https://raw.githubusercontent.com/asterisk/third-party/master/pjproject/$(PJPROJECT_VERSION),
where PJPROJECT_VERSION is defined in asterisk/third-party/versions.mak:
PJPROJECT_VERSION=2.14
On top of that, it applies some patches adapting build system, found in
asterisk/third-party/pjproject/patches/.
The build system also allows to use an out-of-tree pjproject (eg from a
git repo) by symlinking the directory to
asterisk/third-party/pjprojec/source/.
This is all documented in asterisk/third-party/pjproject/README-hacking.md.
Since we want to develop on pjproject too, fetch our own pjproject.git
repo, where we can push changes, and build asterisk using that repo.
Bear in mind that, when asterisk.git builds with out-of-tree pjproject,
it wont apply pjproject patches under asterisk.git/third-party/pjproject/patches.
Hence, I created an "asterisk/2.14" branch in our pjproject.git repo which points
to tag "2.14" (the one used by asterisk 20.7.0, which we use), and has the 2 patches
applied on top.
Then, we have our own "sysmocom/2.14" branch on top of that "asterisk/2.14"
branch, where we put our development. WIP development can also be done in whatever
branch on top of "asterisk/2.14" branch.
Change-Id: I73f3323db1b6897fc43215578b0a011fdb6909c5
2024-04-26 16:04:20 +00:00
|
|
|
PJPROJECT_BRANCH?=sysmocom/2.14
|
2022-02-05 13:21:25 +00:00
|
|
|
BUILD_ARGS?=
|
2022-02-11 08:43:40 +00:00
|
|
|
RUN_ARGS?=-it
|
2023-09-27 09:13:43 +00:00
|
|
|
UPSTREAM_DISTRO?=debian:bookworm
|
|
|
|
DISTRO?=debian-bookworm
|
2021-04-30 13:24:00 +00:00
|
|
|
|
|
|
|
# Full OBS repository mirror consists of:
|
|
|
|
# ${OSMOCOM_REPO_MIRROR}/${OSMOCOM_REPO_PATH}/${OSMOCOM_REPO_VERSION}
|
2022-06-27 12:10:43 +00:00
|
|
|
# e.g. "https://downloads.osmocom.org/packages/osmocom:/latest/"
|
2021-04-30 13:24:00 +00:00
|
|
|
#
|
2020-11-18 16:52:56 +00:00
|
|
|
# Use if down: OSMOCOM_REPO_MIRROR=http://ftp.uni-stuttgart.de/opensuse
|
2022-06-27 12:10:43 +00:00
|
|
|
OSMOCOM_REPO_MIRROR?=https://downloads.osmocom.org
|
|
|
|
OSMOCOM_REPO_PATH?=packages/osmocom:
|
2021-04-30 13:24:00 +00:00
|
|
|
# Use "nightly" to use the nightly feed
|
2020-11-18 15:48:07 +00:00
|
|
|
OSMOCOM_REPO_VERSION?=latest
|
2021-04-30 14:39:09 +00:00
|
|
|
# Build the testsuite with the following mirror. In jenkins we always want to
|
2022-06-27 12:10:43 +00:00
|
|
|
# point this to http://downloads.osmocom.org, so the same testsuite can be
|
2021-04-30 14:39:09 +00:00
|
|
|
# used no matter which OSMOCOM_REPO_MIRROR is set. This avoids rebuilding the
|
|
|
|
# testsuite when we only want to change OSMOCOM_REPO_MIRROR to build different
|
|
|
|
# subjects under test, and it works even if the OSMOCOM_REPO_MIRROR only has
|
|
|
|
# a subset of the network:osmocom:latest packages (i.e. no eclipse-titan).
|
|
|
|
OSMOCOM_REPO_TESTSUITE_MIRROR?=$(OSMOCOM_REPO_MIRROR)
|
2017-08-19 17:31:49 +00:00
|
|
|
|
2021-03-10 17:44:35 +00:00
|
|
|
ROOT_DIR=$(shell git rev-parse --show-toplevel)
|
|
|
|
RELEASE_SUPPORT := $(ROOT_DIR)/make/.make-release-support
|
2018-06-03 17:17:58 +00:00
|
|
|
IMAGE?=$(REGISTRY_HOST)/$(USER)/$(NAME)
|
2017-08-19 17:31:49 +00:00
|
|
|
|
2018-06-03 15:51:55 +00:00
|
|
|
VERSION?=$(shell . $(RELEASE_SUPPORT) ; getRelease)
|
2017-08-19 17:31:49 +00:00
|
|
|
|
|
|
|
SHELL=/bin/bash
|
|
|
|
|
2018-06-03 15:53:03 +00:00
|
|
|
.PHONY: pre-build docker-build post-build build release patch-release minor-release major-release tag showver \
|
2017-08-19 17:31:49 +00:00
|
|
|
push do-push post-push
|
|
|
|
|
|
|
|
build: pre-build docker-build post-build
|
|
|
|
|
|
|
|
pre-build:
|
2021-03-09 23:29:52 +00:00
|
|
|
rm -rf .common
|
|
|
|
cp -r $(ROOT_DIR)/common .common
|
2017-08-19 17:31:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
post-build:
|
2021-03-09 23:29:52 +00:00
|
|
|
rm -rf .common
|
2017-08-19 17:31:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
post-push:
|
|
|
|
|
|
|
|
|
|
|
|
docker-build: .release
|
2020-05-30 06:24:41 +00:00
|
|
|
docker build \
|
|
|
|
--build-arg USER=$(USERNAME) \
|
2021-04-28 15:22:01 +00:00
|
|
|
--build-arg UID=$(UID) \
|
2020-11-02 13:24:39 +00:00
|
|
|
--build-arg REGISTRY=$(REGISTRY_HOST) \
|
2020-05-30 06:24:41 +00:00
|
|
|
--build-arg OSMO_TTCN3_BRANCH=$(OSMO_TTCN3_BRANCH) \
|
2020-11-18 15:45:28 +00:00
|
|
|
--build-arg UPSTREAM_DISTRO=$(UPSTREAM_DISTRO) \
|
2020-05-30 06:24:41 +00:00
|
|
|
--build-arg DISTRO=$(DISTRO) \
|
2020-11-18 16:52:56 +00:00
|
|
|
--build-arg OSMOCOM_REPO_MIRROR=$(OSMOCOM_REPO_MIRROR) \
|
2021-04-30 13:24:00 +00:00
|
|
|
--build-arg OSMOCOM_REPO_PATH=$(OSMOCOM_REPO_PATH) \
|
2020-11-18 15:48:07 +00:00
|
|
|
--build-arg OSMOCOM_REPO_VERSION=$(OSMOCOM_REPO_VERSION) \
|
2021-04-30 14:39:09 +00:00
|
|
|
--build-arg OSMOCOM_REPO_TESTSUITE_MIRROR=$(OSMOCOM_REPO_TESTSUITE_MIRROR) \
|
2024-03-28 20:22:37 +00:00
|
|
|
--build-arg ASTERISK_BRANCH=$(ASTERISK_BRANCH) \
|
2020-06-30 16:23:01 +00:00
|
|
|
--build-arg LIBOSMOCORE_BRANCH=$(LIBOSMOCORE_BRANCH) \
|
2022-12-14 11:42:55 +00:00
|
|
|
--build-arg LIBOSMOABIS_BRANCH=$(LIBOSMOABIS_BRANCH) \
|
|
|
|
--build-arg LIBOSMONETIF_BRANCH=$(LIBOSMONETIF_BRANCH) \
|
2019-11-05 12:02:24 +00:00
|
|
|
--build-arg OSMO_BB_BRANCH=$(OSMO_BB_BRANCH) \
|
2019-04-25 11:56:14 +00:00
|
|
|
--build-arg OSMO_BSC_BRANCH=$(OSMO_BSC_BRANCH) \
|
|
|
|
--build-arg OSMO_BTS_BRANCH=$(OSMO_BTS_BRANCH) \
|
2022-06-16 14:26:42 +00:00
|
|
|
--build-arg OSMO_CBC_BRANCH=$(OSMO_CBC_BRANCH) \
|
2023-08-23 14:33:28 +00:00
|
|
|
--build-arg OSMO_DIA2GSUP_BRANCH=$(OSMO_DIA2GSUP_BRANCH) \
|
2023-10-04 17:08:42 +00:00
|
|
|
--build-arg OSMO_EPDG_BRANCH=$(OSMO_EPDG_BRANCH) \
|
2021-02-02 17:39:02 +00:00
|
|
|
--build-arg OSMO_GBPROXY_BRANCH=$(OSMO_GBPROXY_BRANCH) \
|
2019-04-25 11:56:14 +00:00
|
|
|
--build-arg OSMO_GGSN_BRANCH=$(OSMO_GGSN_BRANCH) \
|
2020-01-30 15:29:08 +00:00
|
|
|
--build-arg OSMO_GSM_TESTER_BRANCH=$(OSMO_GSM_TESTER_BRANCH) \
|
2019-04-25 11:56:14 +00:00
|
|
|
--build-arg OSMO_HLR_BRANCH=$(OSMO_HLR_BRANCH) \
|
2022-01-05 11:44:14 +00:00
|
|
|
--build-arg OSMO_HNBGW_BRANCH=$(OSMO_HNBGW_BRANCH) \
|
2021-10-28 19:05:06 +00:00
|
|
|
--build-arg OSMO_HNODEB_BRANCH=$(OSMO_HNODEB_BRANCH) \
|
2019-04-25 11:56:14 +00:00
|
|
|
--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) \
|
2022-04-11 13:51:11 +00:00
|
|
|
--build-arg OSMO_UECUPS_BRANCH=$(OSMO_UECUPS_BRANCH) \
|
2022-02-03 17:53:52 +00:00
|
|
|
--build-arg OPEN5GS_BRANCH=$(OPEN5GS_BRANCH) \
|
asterisk-master: Use pjproject from external git repo
By default, asterisk.git build system will fetch pjproject tarball from
https://raw.githubusercontent.com/asterisk/third-party/master/pjproject/$(PJPROJECT_VERSION),
where PJPROJECT_VERSION is defined in asterisk/third-party/versions.mak:
PJPROJECT_VERSION=2.14
On top of that, it applies some patches adapting build system, found in
asterisk/third-party/pjproject/patches/.
The build system also allows to use an out-of-tree pjproject (eg from a
git repo) by symlinking the directory to
asterisk/third-party/pjprojec/source/.
This is all documented in asterisk/third-party/pjproject/README-hacking.md.
Since we want to develop on pjproject too, fetch our own pjproject.git
repo, where we can push changes, and build asterisk using that repo.
Bear in mind that, when asterisk.git builds with out-of-tree pjproject,
it wont apply pjproject patches under asterisk.git/third-party/pjproject/patches.
Hence, I created an "asterisk/2.14" branch in our pjproject.git repo which points
to tag "2.14" (the one used by asterisk 20.7.0, which we use), and has the 2 patches
applied on top.
Then, we have our own "sysmocom/2.14" branch on top of that "asterisk/2.14"
branch, where we put our development. WIP development can also be done in whatever
branch on top of "asterisk/2.14" branch.
Change-Id: I73f3323db1b6897fc43215578b0a011fdb6909c5
2024-04-26 16:04:20 +00:00
|
|
|
--build-arg PJPROJECT_BRANCH=$(PJPROJECT_BRANCH) \
|
2022-02-05 13:21:25 +00:00
|
|
|
$(BUILD_ARGS) -t $(IMAGE):latest .
|
2017-08-19 17:31:49 +00:00
|
|
|
@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) ; \
|
2017-10-15 14:45:03 +00:00
|
|
|
|
2018-06-03 15:53:03 +00:00
|
|
|
tag: docker-build
|
2017-08-19 17:31:49 +00:00
|
|
|
if [ $$DOCKER_MAJOR -eq 1 ] && [ $$DOCKER_MINOR -lt 10 ] ; then \
|
2017-10-15 14:45:03 +00:00
|
|
|
echo docker tag -f $(IMAGE):latest $(IMAGE):$(VERSION) ;\
|
|
|
|
docker tag -f $(IMAGE):latest $(IMAGE):$(VERSION) ;\
|
2017-08-19 17:31:49 +00:00
|
|
|
else \
|
2017-10-15 14:45:03 +00:00
|
|
|
echo docker tag $(IMAGE):latest $(IMAGE):$(VERSION) ;\
|
|
|
|
docker tag $(IMAGE):latest $(IMAGE):$(VERSION) ; \
|
2017-08-19 17:31:49 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
.release:
|
|
|
|
@echo "release=0.0.0" > .release
|
|
|
|
@echo INFO: .release created
|
|
|
|
@cat .release
|
|
|
|
|
|
|
|
|
2018-06-03 15:53:03 +00:00
|
|
|
release: build push
|
2017-08-19 17:31:49 +00:00
|
|
|
|
|
|
|
|
2019-10-23 15:58:05 +00:00
|
|
|
push: do-push post-push
|
2017-08-19 17:31:49 +00:00
|
|
|
|
2019-10-23 15:58:05 +00:00
|
|
|
do-push:
|
2017-08-19 17:31:49 +00:00
|
|
|
docker push $(IMAGE):latest
|
2018-06-03 15:40:12 +00:00
|
|
|
[ -f .release ] && docker push $(IMAGE):$(VERSION)
|
2017-08-19 17:31:49 +00:00
|
|
|
|
|
|
|
snapshot: build push
|
|
|
|
|
|
|
|
showver: .release
|
|
|
|
@. $(RELEASE_SUPPORT); getVersion
|
|
|
|
|
|
|
|
tag-patch-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextPatchLevel)
|
2019-10-23 15:58:05 +00:00
|
|
|
tag-patch-release: .release tag
|
2017-08-19 17:31:49 +00:00
|
|
|
|
|
|
|
tag-minor-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextMinorLevel)
|
2019-10-23 15:58:05 +00:00
|
|
|
tag-minor-release: .release tag
|
2017-08-19 17:31:49 +00:00
|
|
|
|
|
|
|
tag-major-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextMajorLevel)
|
2019-10-23 15:58:05 +00:00
|
|
|
tag-major-release: .release tag
|
2017-08-19 17:31:49 +00:00
|
|
|
|
|
|
|
patch-release: tag-patch-release release
|
|
|
|
@echo $(VERSION)
|
|
|
|
|
|
|
|
minor-release: tag-minor-release release
|
|
|
|
@echo $(VERSION)
|
|
|
|
|
|
|
|
major-release: tag-major-release release
|
|
|
|
@echo $(VERSION)
|
|
|
|
|
2022-02-11 14:24:28 +00:00
|
|
|
# Always use --rm, so we don't waste disk space
|
|
|
|
# https://osmocom.org/projects/osmocom-servers/wiki/Docker_cache_clean_up
|
2017-08-19 17:51:35 +00:00
|
|
|
run:
|
2022-02-11 14:24:28 +00:00
|
|
|
docker run --rm $(RUN_ARGS) $(IMAGE) $(RUN_CMD)
|