From 799d936cc6c5cd94d8f4a594e2772a54b0ddb61f Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Mon, 25 May 2020 11:06:28 +0200 Subject: OBS: add osmocom-next-packages.sh Fill the "next" feed with source packages generated from the "next" branch of each Osmocom project, if it exists, with fallback to the "master" branch. Implement as wrapper around osmocom-nightly-packages.sh, so we don't duplicate code and don't need to add more logic to the jenkins job. Adjust all osmo_obs_prepare_conflict calls. Add a comment line on top of each osmocom-*-packages.sh script stating the feed they can be used with. Related: SYS#4887 Change-Id: I0542b6243bdd29d08381fcc82368dcbd30bf9dce --- scripts/osmocom-latest-packages.sh | 3 ++- scripts/osmocom-next-packages.sh | 6 ++++++ scripts/osmocom-nightly-packages.sh | 43 +++++++++++++++++++++++++++++++------ 3 files changed, 45 insertions(+), 7 deletions(-) create mode 100755 scripts/osmocom-next-packages.sh (limited to 'scripts') diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh index 4d5b3f3..46d8a0f 100755 --- a/scripts/osmocom-latest-packages.sh +++ b/scripts/osmocom-latest-packages.sh @@ -1,4 +1,5 @@ #!/bin/sh +# Generate source packages and upload them to OBS, for the latest feed. . "$(dirname "$0")/common.sh" . "$(dirname "$0")/common-obs.sh" @@ -24,7 +25,7 @@ prepare() { mkdir "$DEBSRCDIR" cd "$TOP" - osmo_obs_prepare_conflict "osmocom-latest" "osmocom-nightly" + osmo_obs_prepare_conflict "osmocom-latest" "osmocom-nightly" "osmocom-next" } get_last_tag() { diff --git a/scripts/osmocom-next-packages.sh b/scripts/osmocom-next-packages.sh new file mode 100755 index 0000000..aa9ab90 --- /dev/null +++ b/scripts/osmocom-next-packages.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Generate source packages and upload them to OBS, for the next feed. +. "$(dirname "$0")/common.sh" + +export FEED="next" +$OSMO_CI_DIR/scripts/osmocom-nightly-packages.sh diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 40f2a6c..4a0bc80 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -1,16 +1,35 @@ #!/bin/bash +# Generate source packages and upload them to OBS, for the nightly or next feed. +# Environment variables: +# * FEED: the binary package feed to upload to, this also controls the source branch that is used: +# * "nightly": use "master" branch (default) +# * "next": use "next" branch if it exists, otherwise use "master" branch . "$(dirname "$0")/common.sh" . "$(dirname "$0")/common-obs.sh" set -e set -x -# OBS project name -PROJ=network:osmocom:nightly - DT=$(date +%Y%m%d) 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 +} + ### OBS build prepare() { # clean up the whole space @@ -19,7 +38,14 @@ prepare() { osc co "$PROJ" cd "$REPO" - osmo_obs_prepare_conflict "osmocom-nightly" "osmocom-latest" + 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 } get_last_tag() { @@ -70,6 +96,10 @@ checkout() { osmo_git_clone_date "$url" fi + if [ "$FEED" = "next" ] && git -C "$name" show-branch remotes/origin/next >/dev/null 2>&1; then + git -C "$name" checkout next + fi + cd - } @@ -99,7 +129,7 @@ build() { if [ "$changelog" = "commit" ] ; then VER=$(get_commit_version) - osmo_obs_add_debian_dependency "./debian/control" "osmocom-nightly" + osmo_obs_add_debian_dependency "./debian/control" "osmocom-$FEED" dch -b -v "$VER" -m "Snapshot build" git commit -m "$VER snapshot" debian/ fi @@ -213,7 +243,7 @@ build_osmocom() { osmo_obs_checkout_copy debian8 osmo-trx osmo_obs_checkout_copy debian10 limesuite - build osmocom-nightly + build osmocom-$FEED build limesuite no_commit --git-upstream-tree="$(get_last_tag limesuite)" build limesuite-debian10 no_commit --git-upstream-tree="$(get_last_tag limesuite)" build osmo-gsm-manuals @@ -256,4 +286,5 @@ build_osmocom() { post } +parse_feed_proj build_osmocom -- cgit v1.2.3