summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ansible/hosts3
-rw-r--r--ansible/roles/gsm-tester/tasks/main.yml2
-rw-r--r--ansible/roles/osmocom-workstation/tasks/git-repos.yml8
-rwxr-xr-xcoverity/prepare_source_Osmcocom.sh2
-rw-r--r--jobs/master-builds.yml10
-rw-r--r--jobs/osmocom-obs.yml3
-rw-r--r--jobs/osmocom-release-tarballs.yml10
-rw-r--r--jobs/ttcn3-testsuites.yml40
-rw-r--r--jobs/update-osmo-ci-on-slaves.yml1
-rw-r--r--jobs/update-osmo-python-on-slaves.yml1
-rw-r--r--scripts/common-obs-conflict.sh24
-rw-r--r--scripts/common-obs.sh101
-rwxr-xr-xscripts/osmo-ci-docker-rebuild.sh6
-rwxr-xr-xscripts/osmo-layer1-headers.sh2
-rwxr-xr-xscripts/osmocom-latest-packages.sh70
-rwxr-xr-xscripts/osmocom-nightly-packages.sh111
-rwxr-xr-xscripts/osmocom-packages-docker.sh35
-rwxr-xr-xscripts/repo-install-test/run-inside-docker.sh1
18 files changed, 327 insertions, 103 deletions
diff --git a/ansible/hosts b/ansible/hosts
index 892428b..d88147a 100644
--- a/ansible/hosts
+++ b/ansible/hosts
@@ -12,7 +12,8 @@ admin2-deb9build ansible_host=2a01:4f8:13b:828::1:300 osmocom_jenkins_slave_fstr
build2-deb9build-ansible ansible_host=2a01:4f8:10b:2ad9::1:6 osmocom_jenkins_slave_fstrim=True
build2-deb10build-ansible ansible_host=2a01:4f8:10b:2ad9::1:10 osmocom_jenkins_slave_fstrim=True
host2-deb9build-ansible ansible_host=2a01:4f8:120:8470::1:3 osmocom_jenkins_slave_fstrim=True
-gtp0-deb9build ansible_host=10.34.2.147 osmocom_jenkins_slave_fstrim=True
+gtp0-deb9build ansible_host=10.34.2.102 osmocom_jenkins_slave_fstrim=True
+gtp0-deb10build ansible_host=10.34.2.101 osmocom_jenkins_slave_fstrim=True
rpi4-raspbian10build-ansible-1 ansible_host=10.9.25.50
rpi4-raspbian10build-ansible-2 ansible_host=10.9.25.60
rpi4-raspbian10build-ansible-3 ansible_host=10.9.25.70
diff --git a/ansible/roles/gsm-tester/tasks/main.yml b/ansible/roles/gsm-tester/tasks/main.yml
index 418509e..7d28558 100644
--- a/ansible/roles/gsm-tester/tasks/main.yml
+++ b/ansible/roles/gsm-tester/tasks/main.yml
@@ -132,7 +132,7 @@
- name: setup ofono repository
git:
- repo: 'git://git.sysmocom.de/ofono'
+ repo: 'https://git.sysmocom.de/sysmocom/ofono'
dest: /root/ofono
version: osmo-gsm-tester
clone: yes
diff --git a/ansible/roles/osmocom-workstation/tasks/git-repos.yml b/ansible/roles/osmocom-workstation/tasks/git-repos.yml
index 79f7f31..d829892 100644
--- a/ansible/roles/osmocom-workstation/tasks/git-repos.yml
+++ b/ansible/roles/osmocom-workstation/tasks/git-repos.yml
@@ -104,16 +104,16 @@
chdir: "{{ git_destination }}/osmo-ttcn3-hacks"
- name: install sysmocom git repos
- git: repo=git://git.sysmocom.de/{{ item }}.git
+ git: repo=https://git.sysmocom.de/{{ item }}.git
dest={{ git_destination }}/{{ item }}
accept_hostkey=yes
force=yes
recursive=no
with_items:
- sysmo-bts/layer1-api
- - poky/meta-sysmocom-bsp
- - rs-backup-suite
- - sysmo-usim-tool
+ - sysmo-bts/meta-sysmocom-bsp
+ - hwelte/rs-backup-suite
+ - sysmocom/sysmo-usim-tool
- name: install github git repos
diff --git a/coverity/prepare_source_Osmcocom.sh b/coverity/prepare_source_Osmcocom.sh
index f7129fe..ab1525e 100755
--- a/coverity/prepare_source_Osmcocom.sh
+++ b/coverity/prepare_source_Osmcocom.sh
@@ -37,4 +37,4 @@ for proj in \
fi
done
-git clone git://git.sysmocom.de/sysmo-bts/layer1-api
+git clone https://git.sysmocom.de/sysmo-bts/layer1-api
diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml
index 22fcf15..56e2065 100644
--- a/jobs/master-builds.yml
+++ b/jobs/master-builds.yml
@@ -46,7 +46,7 @@
wrappers: []
trigger:
email: jenkins-notifications@lists.osmocom.org laforge@gnumonks.org
- git_base_url: git.osmocom.org
+ git_base_url: git://git.osmocom.org
# in alphabetical order
repos:
@@ -207,7 +207,7 @@
docker_img: 'registry.osmocom.org/$USER/fpga-build'
cmd: 'docker pull {docker_img} && {docker_run} {docker_img} /build/contrib/jenkins.sh --publish'
- no2bootloader:
- git_base_url: github.com/no2fpga
+ git_base_url: https://github.com/no2fpga
docker_img: 'registry.osmocom.org/$USER/fpga-build'
cmd: 'docker pull {docker_img} && {docker_run} {docker_img} /build/contrib/jenkins.sh --publish'
email: gerrit-log@lists.osmocom.org laforge@gnumonks.org kredon@sysmocom.de 246tnt@gmail.com
@@ -358,7 +358,7 @@
concurrent: false
cmd: cd ./tests; ./run-tests
slave_axis: !!python/tuple [simtester]
- git_base_url: git.sysmocom.de
+ git_base_url: https://git.sysmocom.de/sysmocom
jobs:
- 'master-{repos}'
@@ -377,7 +377,7 @@
artifact-num-to-keep: -1
description: |
Automatic jenkins test job of
- <a href="http://{git_base_url}/{repos}">{repos}</a>
+ <a href="{git_base_url}/{repos}">{repos}</a>
<br/><br/>
<b>Auto-generated using Jenkins Job Builder. DO NOT EDIT MANUALLY!</b>
@@ -410,7 +410,7 @@
scm:
- git:
- url: git://{git_base_url}/{repos}
+ url: "{git_base_url}/{repos}"
branches:
- 'origin/master'
refspec:
diff --git a/jobs/osmocom-obs.yml b/jobs/osmocom-obs.yml
index 4d165d6..9bdadeb 100644
--- a/jobs/osmocom-obs.yml
+++ b/jobs/osmocom-obs.yml
@@ -26,7 +26,8 @@
description: osmo-ci.git branch
default: 'refs/remotes/origin/master'
builders:
- - shell:
+ - shell: |
+ export PROJ=network:osmocom:{type}
./scripts/osmocom-{type}-packages.sh
scm:
- git:
diff --git a/jobs/osmocom-release-tarballs.yml b/jobs/osmocom-release-tarballs.yml
index 4ff1c1c..930fb42 100644
--- a/jobs/osmocom-release-tarballs.yml
+++ b/jobs/osmocom-release-tarballs.yml
@@ -38,9 +38,15 @@
-e KEEP_TEMP="$KEEP_TEMP" \
"$USER/debian-stretch-build-dist" /osmo-ci/scripts/osmocom-release-tarballs.sh
- SSH_COMMAND="ssh -p 48"
+ cat > "$WORKSPACE/known_hosts" <<EOF
+ [ftp.osmocom.org]:48 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDgQ9HntlpWNmh953a2Gc8NysKE4orOatVT1wQkyzhARnfYUerRuwyNr1GqMyBKdSI9amYVBXJIOUFcpV81niA7zQRUs66bpIMkE9/rHxBd81SkorEPOIS84W4vm3SZtuNqa+fADcqe88Hcb0ZdTzjKILuwi19gzrQyME2knHY71EOETe9Yow5RD2hTIpB5ecNxI0LUKDq+Ii8HfBvndPBIr0BWYDugckQ3Bocf+yn/tn2/GZieFEyFpBGF/MnLbAAfUKIdeyFRX7ufaiWWz5yKAfEhtziqdAGZaXNaLG6gkpy3EixOAy6ZXuTAk3b3Y0FUmDjhOHllbPmTOcKMry9
+ [ftp.osmocom.org]:48 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPdWn1kEousXuKsZ+qJEZTt/NSeASxCrUfNDW3LWtH+d8Ust7ZuKp/vuyG+5pe5pwpPOgFu7TjN+0lVjYJVXH54=
+ [ftp.osmocom.org]:48 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK8iivY70EiR5NiGChV39gRLjNpC8lvu1ZdHtdMw2zuX
+ EOF
+
+ SSH_COMMAND="ssh -o 'UserKnownHostsFile=$WORKSPACE/known_hosts' -p 48"
cd _release_tarballs
- rsync -avz --delete -e "$SSH_COMMAND" . releases@rita.osmocom.org:web-files/
+ rsync -avz --delete -e "$SSH_COMMAND" . releases@ftp.osmocom.org:web-files/
scm:
- git:
branches:
diff --git a/jobs/ttcn3-testsuites.yml b/jobs/ttcn3-testsuites.yml
index deaceae..1704327 100644
--- a/jobs/ttcn3-testsuites.yml
+++ b/jobs/ttcn3-testsuites.yml
@@ -126,6 +126,12 @@
blocking: "^(ttcn3|TTCN3-.*)-ns-test-fr.*"
timer: 20 11 * * *
node: hdlc
+ - ttcn3-pcap-client-test:
+ blocking: "^(ttcn3|TTCN3-.*)-pcap-client-test.*"
+ timer: 40 11 * * *
+ - ttcn3-bsc-test-vamos:
+ blocking: "^(ttcn3|TTCN3-.*)-bsc-test.*"
+ timer: 00 12 * * *
# debian-stretch latest stable
- nplab-m3ua-test-latest:
@@ -190,6 +196,10 @@
- ttcn3-cbc-test-latest:
blocking: "^(ttcn3|TTCN3-.*)-cbc-test.*"
timer: 40 10 * * *
+ - ttcn3-pcap-client-test-latest:
+ blocking: "^(ttcn3|TTCN3-.*)-pcap-client-test.*"
+ timer: 40 11 * * *
+
# Jobs below use uppercase TTCN3-$DISTRO, so they get listed separately from the ttcn3-* (debian-stretch) jobs
@@ -294,6 +304,28 @@
blocking: "^(ttcn3|TTCN3-.*)-cbc-test.*"
timer: 40 10 * * *
+ # centos8 2021q1 (SYS#5370)
+ - TTCN3-centos-pcu-test-2021q1:
+ blocking: "^(ttcn3|TTCN3-.*)-pcu-test.*"
+ timer: 00 11 * * *
+ - TTCN3-centos-pcu-test-sns-2021q1:
+ blocking: "^(ttcn3|TTCN3-.*)-pcu-test.*"
+ timer: 15 11 * * *
+ - TTCN3-centos-bsc-test-2021q1:
+ blocking: "^(ttcn3|TTCN3-.*)-bsc-test.*"
+ timer: 30 11 * * *
+ - TTCN3-centos-mgw-test-2021q1:
+ blocking: "^(ttcn3|TTCN3-.*)-mgw-test.*"
+ timer: 45 11 * * *
+ - TTCN3-centos-bts-test-2021q1:
+ blocking: "^(ttcn3|TTCN3-.*)-bts-test.*"
+ timer: 00 12 * * *
+ - TTCN3-centos-smlc-test-2021q1:
+ blocking: "^(ttcn3|TTCN3-.*)-smlc-test.*"
+ timer: 15 12 * * *
+ - TTCN3-centos-gbproxy-test-2021q1:
+ blocking: "^(ttcn3|TTCN3-.*)-gbproxy-test.*"
+ timer: 30 12 * * *
- job-template:
name: '{job-name}'
@@ -349,6 +381,14 @@
DIR="$(echo "{job-name}" | sed s/^TTCN3-centos\-/ttcn3-/ | sed s/\-latest$//)"
export IMAGE_SUFFIX="latest-centos8"
;;
+ TTCN3-centos-*-20*q*)
+ export OSMOCOM_REPO_TESTSUITE_MIRROR="http://download.opensuse.org"
+ export OSMOCOM_REPO_MIRROR="https://downloads.osmocom.org"
+ export OSMOCOM_REPO_PATH="osmo-maintained"
+ export OSMOCOM_REPO_VERSION="$(echo "{job-name}" | grep -o -P -- "20\d\dq.*$")" # e.g. "2021q1"
+ export IMAGE_SUFFIX="$OSMOCOM_REPO_VERSION-centos8"
+ DIR="$(echo "{job-name}" | sed s/^TTCN3-centos\-/ttcn3-/ | sed s/\-$OSMOCOM_REPO_VERSION$//)"
+ ;;
TTCN3-centos-*)
DIR="$(echo "{job-name}" | sed s/^TTCN3-centos\-/ttcn3-/)"
export IMAGE_SUFFIX="master-centos8"
diff --git a/jobs/update-osmo-ci-on-slaves.yml b/jobs/update-osmo-ci-on-slaves.yml
index 254744e..060bba2 100644
--- a/jobs/update-osmo-ci-on-slaves.yml
+++ b/jobs/update-osmo-ci-on-slaves.yml
@@ -7,7 +7,6 @@
name: label
values:
- simtester
- - admin2-deb9build
- host2-deb9build-ansible
- build2-deb9build-ansible
- build2-deb10build-ansible
diff --git a/jobs/update-osmo-python-on-slaves.yml b/jobs/update-osmo-python-on-slaves.yml
index b65604e..598d867 100644
--- a/jobs/update-osmo-python-on-slaves.yml
+++ b/jobs/update-osmo-python-on-slaves.yml
@@ -6,7 +6,6 @@
type: slave
name: label
values:
- - admin2-deb9build
- host2-deb9build-ansible
- build2-deb9build-ansible
- build2-deb10build-ansible
diff --git a/scripts/common-obs-conflict.sh b/scripts/common-obs-conflict.sh
index a4fc98d..98c8b70 100644
--- a/scripts/common-obs-conflict.sh
+++ b/scripts/common-obs-conflict.sh
@@ -2,7 +2,7 @@
# Create conflicting dummy packages in OBS (opensuse build service), so users can't mix packages
# built from different branches by accident
-OSMO_OBS_CONFLICT_PKGVER="1.0.0"
+OSMO_OBS_CONFLICT_PKGVER="${OSMO_OBS_CONFLICT_PKGVER:-1.0.0}"
# Create the conflicting package for debian
#
@@ -113,18 +113,28 @@ EOF
}
-# Create conflicting packages
-# $1: name of dummy package (e.g. "osmocom-nightly")
-# $2-*: name of conflicting packages (e.g. "osmocom-latest")
+# Print names of packages that the conflict package from the current feed
+# (e.g. osmocom-nightly) should conflict with (e.g. osmocom-latest,
+# osmocom-next, osmocom-2021q1)
+osmo_obs_prepare_conflict_args() {
+ for i in $FEEDS_ALL; do
+ if [ "$i" != "$FEED" ]; then
+ echo "osmocom-$i"
+ fi
+ done
+}
+
+# Create conflicting packages, based on global $FEED and $FEEDS_ALL vars
osmo_obs_prepare_conflict() {
- local pkgname="$1"
+ local pkgname="osmocom-$FEED"
+ local conflict_args="$(osmo_obs_prepare_conflict_args)"
local oldpwd="$PWD"
mkdir -p "$pkgname"
cd "$pkgname"
- osmo_obs_prepare_conflict_deb "$@"
- osmo_obs_prepare_conflict_rpm "$@"
+ osmo_obs_prepare_conflict_deb "$pkgname" $conflict_args
+ osmo_obs_prepare_conflict_rpm "$pkgname" $conflict_args
# Put in git repository
git init .
diff --git a/scripts/common-obs.sh b/scripts/common-obs.sh
index 38719c8..1a10eb6 100644
--- a/scripts/common-obs.sh
+++ b/scripts/common-obs.sh
@@ -2,6 +2,13 @@
# Various common code used in the OBS (opensuse build service) related osmo-ci shell scripts
. "$(dirname "$0")/common-obs-conflict.sh"
+FEEDS_ALL="
+ 2021q1
+ latest
+ next
+ nightly
+"
+
osmo_cmd_require \
dch \
dh \
@@ -12,9 +19,12 @@ osmo_cmd_require \
mktemp \
osc \
patch \
- sed \
- wget
+ sed
+if [ -z "$PROJ" ]; then
+ echo "PROJ environment variable is not set"
+ exit 1
+fi
# Add dependency to all (sub)packages in debian/control and commit the change.
# $1: path to debian/control file
@@ -167,6 +177,27 @@ osmo_obs_distro_specific_patch() {
fi
}
+# Check if checkout or build of a given package should be skipped, based on the
+# PACKAGES environment variable.
+# $1: package name (e.g. "libosmocore")
+osmo_obs_skip_pkg() {
+ local pkgname="$1"
+
+ if [ -z "$PACKAGES" ]; then
+ # Don't skip
+ return 1
+ fi
+
+ for i in "osmocom-$FEED" $PACKAGES; do
+ if [ "$i" = "$pkgname" ]; then
+ return 1
+ fi
+ done
+
+ # Skip
+ return 0
+}
+
# Copy an already checked out repository dir and apply a distribution specific patch.
# $PWD must be where all repositories are checked out in subdirs.
# $1: distribution name (e.g. "debian8")
@@ -176,6 +207,10 @@ osmo_obs_checkout_copy() {
local repo="$2"
local patch
+ if osmo_obs_skip_pkg "$repo"; then
+ return
+ fi
+
echo
echo "====> Checking out $repo-$distro"
@@ -214,3 +249,65 @@ osmo_obs_checkout_copy() {
git commit -m "auto-commit: apply $patch" debian/
cd ..
}
+
+# Run git-version-gen inside Osmocom repositories, so the .tarball-version
+# becomes part of the source repository. Usually this would be done with
+# "make dist", but we use git-buildpackage instead.
+osmo_obs_git_version_gen() {
+ if [ -x ./git-version-gen ]; then
+ ./git-version-gen . > .tarball-version 2>/dev/null
+ fi
+}
+
+# Return a version based on the latest tag and commit (e.g. "1.5.1.93.47cc")
+# or fall back to the last debian version (e.g. "2.2.6"). Run
+# osmo_obs_git_version_gen before. $PWD must be inside a git repository.
+osmo_obs_get_commit_version() {
+ local version=""
+
+ if [ -e ".tarball-version" ]; then
+ version=$(cat .tarball-version)
+ # debian doesn't allow '-' in version.
+ version=$(echo "$version" | sed 's/-/./g' )
+ fi
+
+ # deb version
+ deb_version=$(head -1 debian/changelog | cut -d ' ' -f 2 | sed 's,(,,' | sed 's,),,')
+ if [ -z "$version" ] || [ "$version" = "UNKNOWN" ]; then
+ version="$deb_version"
+ else
+ # add epoch from debian/changelog
+ case $deb_version in
+ *:*)
+ epoch=$(echo "$deb_version" | cut -d : -f 1)
+ version=$epoch:$version
+ ;;
+ esac
+ fi
+
+ echo -n "$version"
+}
+
+# Verify that $FEED is in $FEEDS and $FEEDS_ALL
+osmo_obs_verify_feed() {
+ local i
+ local j
+
+ for i in $FEEDS; do
+ if [ "$i" != "$FEED" ]; then
+ continue
+ fi
+
+ for j in $FEEDS_ALL; do
+ if [ "$j" = "$i" ]; then
+ return
+ fi
+ done
+
+ echo "feed found in FEEDS but not FEEDS_ALL: $FEED"
+ exit 1
+ done
+
+ echo "unsupported feed: $FEED"
+ exit 1
+}
diff --git a/scripts/osmo-ci-docker-rebuild.sh b/scripts/osmo-ci-docker-rebuild.sh
index 87c943f..73b3508 100755
--- a/scripts/osmo-ci-docker-rebuild.sh
+++ b/scripts/osmo-ci-docker-rebuild.sh
@@ -6,4 +6,8 @@ docker_images_require \
"debian-stretch-jenkins" \
"debian-buster-jenkins" \
"debian-buster-erlang" \
- "osmo-gsm-tester"
+
+if [ "$(arch)" = "x86_64" ]; then
+ docker_images_require \
+ "osmo-gsm-tester"
+fi
diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh
index 59cad87..f23a888 100755
--- a/scripts/osmo-layer1-headers.sh
+++ b/scripts/osmo-layer1-headers.sh
@@ -11,7 +11,7 @@ set -e -x
case "$1" in
sysmo)
- uri="git://git.sysmocom.de/sysmo-bts/layer1-api"
+ uri="https://git.sysmocom.de/sysmo-bts/layer1-api"
version_prefix=""
version="origin/master"
;;
diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh
index 8eef259..bbdc5a1 100755
--- a/scripts/osmocom-latest-packages.sh
+++ b/scripts/osmocom-latest-packages.sh
@@ -1,17 +1,28 @@
#!/bin/sh
# Generate source packages and upload them to OBS, for the latest feed.
+# New packages are only uploaded if the source changed.
+# Environment variables:
+# * PROJ: the OBS namespace to upload to (e.g. "network:osmocom:latest")
+# * FEED:
+# * "latest": use latest tagged release (default)
+# * other: use last commit of branch of same name, exit with error if it does
+# not exist
+# * PACKAGES: set to a space-separated list of packages to skip all others
. "$(dirname "$0")/common.sh"
. "$(dirname "$0")/common-obs.sh"
+# Values for FEED env var. Adjust FEEDS_ALL in common-obs when changing.
+FEEDS="
+ latest
+"
+
set -e
set -x
-# OBS project name
-PROJ=network:osmocom:latest
-
DT=$(date +%Y%m%d%H%M)
TOP=$(pwd)
DEBSRCDIR="$TOP/debsrc"
+FEED="${FEED:-latest}"
### OBS build
prepare() {
@@ -25,7 +36,7 @@ prepare() {
mkdir "$DEBSRCDIR"
cd "$TOP"
- osmo_obs_prepare_conflict "osmocom-latest" "osmocom-nightly" "osmocom-next"
+ osmo_obs_prepare_conflict
}
get_last_tag() {
@@ -44,6 +55,10 @@ checkout() {
url=$2
gitbpargs=""
+ if osmo_obs_skip_pkg "$project"; then
+ return
+ fi
+
if [ -z "$url" ]; then
url="$(osmo_git_clone_url "$project")"
fi
@@ -54,26 +69,50 @@ checkout() {
[ -d "$project" ] || osmo_git_clone_date "$url" "$project"
cd "$project"
git fetch
- VER=$(get_last_tag "$project")
- git checkout -f -B "$VER" "refs/tags/$VER"
+
+ if [ "$FEED" = "latest" ]; then
+ VER=$(get_last_tag "$project")
+ git checkout -f -B "$VER" "refs/tags/$VER"
+ else
+ git checkout -f -B "$FEED" "origin/$FEED"
+ fi
+
if [ "$project" = "open5gs" ]; then
meson subprojects download freeDiameter
fi
}
+# Generate a source package and upload it to OBS
+# $1: package name (e.g. "libosmocore")
+# $2: arguments to pass to "gbp buildpackage"
build() {
project=$1
gitbpargs="$2"
output="$DEBSRCDIR/$project"
+
+ if osmo_obs_skip_pkg "$project"; then
+ return
+ fi
+
echo
echo "====> Building $project"
cd "$TOP/$project"
- VER=$(get_last_tag "$project")
- if [ -x ./git-version-gen ]; then
- ./git-version-gen . > .tarball-version 2>/dev/null
+
+ osmo_obs_git_version_gen
+
+ if [ "$FEED" = "latest" ]; then
+ debian_branch=$(get_last_tag "$project")
+ else
+ debian_branch="$FEED"
+ # Set new debian changelog version with commit appended. This version will
+ # become part of resulting filenames, and will change if commits have been
+ # added to the feed's branch.
+ VER="$(osmo_obs_get_commit_version)"
+ dch -b -v "$VER" -m "Snapshot build"
+ git commit -m "$VER snapshot" debian/
fi
- osmo_obs_add_depend_deb "./debian/control" "$project" "osmocom-latest"
+ osmo_obs_add_depend_deb "./debian/control" "$project" "osmocom-$FEED"
if [ "$project" = "open5gs" ]; then
# we cannot control the output directory of the generated source :(
@@ -82,11 +121,11 @@ build() {
mv "../$name"*.tar* "../$name"*.dsc "$output"
elif [ -x ./git-version-gen ]; then
gbp buildpackage -S -uc -us -d --git-ignore-branch "--git-export-dir=$output" \
- "--git-debian-branch=$VER" --git-ignore-new $gitbpargs \
+ "--git-debian-branch=$debian_branch" --git-ignore-new $gitbpargs \
--git-postexport='cp $GBP_GIT_DIR/../.tarball-version $GBP_TMP_DIR/'
else
gbp buildpackage -S -uc -us -d --git-ignore-branch "--git-export-dir=$output" \
- "--git-debian-branch=$VER" --git-ignore-new $gitbpargs
+ "--git-debian-branch=$debian_branch" --git-ignore-new $gitbpargs
fi
if [ ! -d "$TOP/$PROJ/$project" ] ; then
@@ -109,7 +148,7 @@ build() {
fi
fi
- osmo_obs_add_rpm_spec "$TOP/$PROJ/$project" "$TOP/$project" "$project" "osmocom-latest"
+ osmo_obs_add_rpm_spec "$TOP/$PROJ/$project" "$TOP/$project" "$project" "osmocom-$FEED"
cd "$TOP"
}
@@ -159,7 +198,7 @@ build_osmocom() {
cd "$TOP"
osmo_obs_checkout_copy debian8 osmo-gsm-manuals
- build osmocom-latest
+ build osmocom-$FEED
build limesuite --git-upstream-tree="$(get_last_tag limesuite)"
build osmo-gsm-manuals
build osmo-gsm-manuals-debian8
@@ -196,7 +235,8 @@ build_osmocom() {
build osmo-gbproxy
cd "$TOP/$PROJ"
- osc ci -m "Latest Tagged versions of $DT" --noservice
+ osc ci -m "$FEED versions of $DT" --noservice
}
+osmo_obs_verify_feed
build_osmocom
diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh
index c90ed2f..cd50c7d 100755
--- a/scripts/osmocom-nightly-packages.sh
+++ b/scripts/osmocom-nightly-packages.sh
@@ -1,34 +1,32 @@
#!/bin/bash
# Generate source packages and upload them to OBS, for the nightly or next feed.
+# New packages are always uploaded, even if the source does not change. Only
+# packages of the same build date (DT) can be installed together.
# Environment variables:
-# * FEED: the binary package feed to upload to, this also controls the source branch that is used:
+# * PROJ: the OBS namespace to upload to (e.g. "network:osmocom:nightly")
+# * FEED: controls the source branch that is used:
# * "nightly": use "master" branch (default)
# * "next": use "next" branch if it exists, otherwise use "master" branch
+# * other (e.g. "2021q1"): use last commit of branch of same name, exit with
+# error if it does not exist
+# * PACKAGES: set to a space-separated list of packages to skip all others
. "$(dirname "$0")/common.sh"
. "$(dirname "$0")/common-obs.sh"
+# Values for FEED env var. Adjust FEEDS_ALL in common-obs when changing.
+FEEDS="
+ 2021q1
+ next
+ nightly
+"
+
set -e
set -x
DT=$(date +%Y%m%d%H%M)
+OSMO_OBS_CONFLICT_PKGVER="$OSMO_OBS_CONFLICT_PKGVER.$DT"
TOP=$(pwd)/$(mktemp -d nightly-3g_XXXXXX)
-
-# Set FEED and PROJ, based on the FEED env var
-parse_feed_proj() {
- FEED="${FEED:-nightly}"
- case "$FEED" in
- nightly)
- PROJ=network:osmocom:nightly
- ;;
- next)
- PROJ=network:osmocom:next
- ;;
- *)
- echo "unsupported feed: $FEED"
- exit 1
- ;;
- esac
-}
+FEED="${FEED:-nightly}"
### OBS build
prepare() {
@@ -38,14 +36,7 @@ prepare() {
osc co "$PROJ"
cd "$REPO"
- case "$FEED" in
- nightly)
- osmo_obs_prepare_conflict "osmocom-nightly" "osmocom-latest" "osmocom-next"
- ;;
- next)
- osmo_obs_prepare_conflict "osmocom-next" "osmocom-latest" "osmocom-nightly"
- ;;
- esac
+ osmo_obs_prepare_conflict
}
get_last_tag() {
@@ -59,43 +50,27 @@ get_last_tag() {
echo "${VER}"
}
-get_commit_version() {
- # return a version based on the commit
- local version
-
- # determine git version *and generate the .tarball-version file*
- test -x ./git-version-gen && ./git-version-gen . > .tarball-version 2>/dev/null
- version=$(cat .tarball-version)
- # debian doesn't allow '-' in version.
- version=$(echo "$version" | sed 's/-/./g' )
-
- # deb version
- deb_version=$(head -1 debian/changelog | cut -d ' ' -f 2 | sed 's,(,,' | sed 's,),,')
- if [ -z "$version" ] || [ "$version" = "UNKNOWN" ]; then
- version="$deb_version.$DT"
- else
- # add epoch from debian/changelog
- case $deb_version in
- *:*)
- epoch=$(echo "$deb_version" | cut -d : -f 1)
- version=$epoch:$version
- ;;
- esac
- fi
-
- echo -n "$version"
-}
-
### common
checkout() {
local name=$1
local url=$2
local branch=$3
+ if osmo_obs_skip_pkg "$name"; then
+ return
+ fi
+
if [ -z "$url" ]; then
url="$(osmo_git_clone_url "$name")"
fi
+ if [ -z "$branch" ]; then
+ case "$FEED" in
+ nightly|next) ;;
+ *) branch="$FEED" ;; # e.g. 2021q1
+ esac
+ fi
+
cd "$REPO"
if [ -n "$branch" ] ; then
@@ -111,16 +86,22 @@ checkout() {
cd -
}
+# Generate a source package and upload it to OBS
+# $1: package name (e.g. "libosmocore")
+# $2: update debian dir, unless set to "no_commit":
+# * add dependency on osmocom-$FEED package
+# * add new version to changelog (e.g. "1.5.1.96.c96d7.202104281354")
+# $3: arguments to pass to "gbp buildpackage"
build() {
local name=$1
local changelog=$2
local gitbpargs=$3
local repodir=$REPO/$name
local oscdir=$REPO/osc/$PROJ/$name
- local dependver="$OSMO_OBS_CONFLICT_PKGVER.$DT"
+ local dependver="$OSMO_OBS_CONFLICT_PKGVER"
- if [ -z "$changelog" ] ; then
- changelog=commit
+ if osmo_obs_skip_pkg "$name"; then
+ return
fi
if [ -d "$oscdir" ] ; then
@@ -136,8 +117,10 @@ build() {
cd "$repodir"
- if [ "$changelog" = "commit" ] ; then
- VER=$(get_commit_version)
+ if [ "$changelog" != "no_commit" ] ; then
+ osmo_obs_git_version_gen
+ # Add date to increase version even if commit did not change (OS#5135)
+ VER="$(osmo_obs_get_commit_version).$DT"
osmo_obs_add_depend_deb "./debian/control" "$name" "osmocom-$FEED" "$dependver"
dch -b -v "$VER" -m "Snapshot build"
git commit -m "$VER snapshot" debian/
@@ -171,6 +154,10 @@ post() {
}
checkout_limesuite() {
+ if osmo_obs_skip_pkg "limesuite"; then
+ return
+ fi
+
cd "$REPO"
git clone https://github.com/myriadrf/LimeSuite limesuite
TAG="$(get_last_tag limesuite)"
@@ -179,6 +166,10 @@ checkout_limesuite() {
}
checkout_open5gs() {
+ if osmo_obs_skip_pkg "open5gs"; then
+ return
+ fi
+
cd "$REPO"
git clone https://github.com/open5gs/open5gs
cd open5gs
@@ -239,7 +230,7 @@ build_osmocom() {
osmo_obs_checkout_copy debian8 osmo-gsm-manuals
osmo_obs_checkout_copy debian8 osmo-trx
- build osmocom-$FEED
+ build osmocom-$FEED no_commit
build limesuite no_commit --git-upstream-tree="$(get_last_tag limesuite)"
build osmo-gsm-manuals
build osmo-gsm-manuals-debian8
@@ -282,5 +273,5 @@ build_osmocom() {
post
}
-parse_feed_proj
+osmo_obs_verify_feed
build_osmocom
diff --git a/scripts/osmocom-packages-docker.sh b/scripts/osmocom-packages-docker.sh
new file mode 100755
index 0000000..a7a804b
--- /dev/null
+++ b/scripts/osmocom-packages-docker.sh
@@ -0,0 +1,35 @@
+#!/bin/sh -ex
+# Run osmocom-*-packages.sh in a docker container, so dependencies don't need
+# to be installed on the host machine. See osmocom-nightly-packages.sh and
+# osmocom-latest-packages.sh for supported environment variables.
+SCRIPTS="$(realpath "$(dirname "$0")")"
+IMAGE="debian10-obs-submit"
+OSCRC="${OSCRC:-.oscrc}"
+
+if ! [ -f "$OSCRC" ]; then
+ echo "ERROR: missing OSCRC (should point to OSC credentials file)"
+ exit 1
+fi
+
+. "$SCRIPTS/common.sh"
+docker_images_require "$IMAGE"
+
+case "$FEED" in
+nightly|next|latest)
+ SCRIPT="osmocom-$FEED-packages.sh"
+ ;;
+*)
+ # "2021q1" etc, osmocom-nightly-packages.sh verifies and uses $FEED
+ SCRIPT="osmocom-nightly-packages.sh"
+ ;;
+esac
+
+docker run \
+ -e "FEED=$FEED" \
+ -e "OSMO_OBS_CONFLICT_PKGVER=$OSMO_OBS_CONFLICT_PKGVER" \
+ -e "PACKAGES=$PACKAGES" \
+ -e "PROJ=$PROJ" \
+ -v "$SCRIPTS:/scripts" \
+ -v "$(realpath "$OSCRC"):/home/user/.oscrc" \
+ "$USER/$IMAGE" \
+ sh -c "cd ~ && /scripts/$SCRIPT"
diff --git a/scripts/repo-install-test/run-inside-docker.sh b/scripts/repo-install-test/run-inside-docker.sh
index 4a5f01a..91c8375 100755
--- a/scripts/repo-install-test/run-inside-docker.sh
+++ b/scripts/repo-install-test/run-inside-docker.sh
@@ -379,6 +379,7 @@ services_check() {
for service in $services_feed; do
if ! systemctl --no-pager -l -n 200 status $service; then
failed="$failed $service"
+ journalctl -u "$service" -n 200
fi
done