summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2017-08-03 19:51:52 +0000
committerAlexander Couzens <lynxis@fe80.eu>2017-08-15 17:13:14 +0200
commita0d34c1b8dea0d793ab61cb5ff9deb352928dd95 (patch)
tree7cfd23f73918f5fcfd36dd3ec058c3ab4ced2482
parentefcf6881a205df5b110d859191cfd1ea3fe8a48d (diff)
create osmocom-nightly-nitb-split.sh based on osmocom-nightly-packages.sh
Create a snapshot of the nitb split and upload it to OBS. Change-Id: I8bf9fce1547e98c44b62a693ac4aaa4beed1aef9
-rwxr-xr-xscripts/osmocom-nightly-nitb-split.sh119
1 files changed, 119 insertions, 0 deletions
diff --git a/scripts/osmocom-nightly-nitb-split.sh b/scripts/osmocom-nightly-nitb-split.sh
new file mode 100755
index 0000000..ee39a5b
--- /dev/null
+++ b/scripts/osmocom-nightly-nitb-split.sh
@@ -0,0 +1,119 @@
+#!/bin/bash
+
+set -e
+set -x
+
+DT=$(date +%Y%m%d)
+PROJ=network:osmocom:nitb-split:nightly
+
+### common
+checkout() {
+ local name=$1
+ local branch=$2
+ local url="git://git.osmocom.org"
+
+ cd "$REPO"
+
+ if [ -n "$branch" ] ; then
+ git clone "$url/$name" -b "$branch"
+ else
+ git clone "$url/$name"
+ fi
+
+ cd -
+}
+
+### OBS build
+prepare() {
+ # clean up the whole space
+ mkdir -p "$REPO/osc/"
+ cd "$REPO/osc"
+ osc co "$PROJ"
+}
+
+build() {
+ local name=$1
+ local repodir=$REPO/$name
+ local oscdir=$REPO/osc/$PROJ/$name
+
+ if [ -d "$oscdir" ] ; then
+ # remove earlier version
+ cd "$oscdir"
+ osc rm -- * || true
+ else
+ # new package
+ mkdir -p "$oscdir/"
+ cd "$REPO/osc/$PROJ/"
+ osc add "$name"
+ fi
+
+ cd "$repodir"
+
+ VER=$(head -1 debian/changelog | cut -d ' ' -f 2 | sed 's,(,,' | sed 's,),,')
+ dch -v "$VER.$DT" -m "Snapshot build"
+ git commit -m "$DT snapshot" debian/
+
+ mkdir -p "$DATA/$name"
+ # source code build without dependency checks and unsigned source and unsigned change log
+ gbp buildpackage -S -uc -us -d --git-ignore-branch "--git-export-dir=$DATA/$name"
+
+ mv "$DATA/$name/"*.tar* "$DATA/$name/"*.dsc "$oscdir/"
+
+ cd "$oscdir"
+ osc add -- *.tar* *.dsc
+ osc ci -m "Snapshot $name $DT"
+}
+
+post() {
+ cd "$REPO/osc/$PROJ/"
+ osc status
+}
+
+build_osmocom() {
+ BASE=$PWD
+ DATA=$BASE/data
+ REPO=$BASE/repo
+
+ # rather than including a dangerous 'rm -rf *' here, lets delegate to the user:
+ if [ -n "$(ls)" ]; then
+ echo "ERROR: I need to run in an empty directory."
+ exit 1
+ fi
+
+ prepare
+
+ checkout libosmocore
+ checkout libosmo-abis
+ checkout libosmo-netif
+ checkout libosmo-sccp
+ checkout libsmpp34
+ checkout libasn1c
+ checkout osmo-iuh lynxis/pre_release
+ checkout osmo-hlr
+ checkout openggsn
+ checkout osmo-mgw pre_release
+ checkout osmo-bsc lynxis/pre_release
+ checkout osmo-msc pre_release
+ checkout osmo-sgsn pre_release
+
+ build libosmocore
+ build libosmo-abis
+ build libosmo-netif
+ build libosmo-sccp
+ build libsmpp34
+ build libasn1c
+ build osmo-iuh
+ build osmo-hlr
+ build openggsn
+ build osmo-mgw
+ build osmo-bsc
+ build osmo-msc
+ build osmo-sgsn
+
+ post
+}
+
+TMPDIR=$(mktemp -d nightly-3g_XXXXXX)
+cd "$TMPDIR"
+build_osmocom
+rm -rf "./$TMPDIR/"