[PATCH] osmo-ci[master]: create osmocom-nightly-nitb-split.sh based on osmocom-nightl...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

lynxis lazus gerrit-no-reply at lists.osmocom.org
Tue Aug 15 15:14:44 UTC 2017


Review at  https://gerrit.osmocom.org/3529

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
---
A scripts/osmocom-nightly-nitb-split.sh
1 file changed, 119 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/29/3529/1

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/"

-- 
To view, visit https://gerrit.osmocom.org/3529
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8bf9fce1547e98c44b62a693ac4aaa4beed1aef9
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>



More information about the gerrit-log mailing list