From 6e95ca405aa3468465f9768b08e25487366c113c Mon Sep 17 00:00:00 2001 From: nrbffs <git-ffs@nicoboehr.de> Date: Sun, 9 Jun 2019 16:21:18 +0200 Subject: [PATCH] CI: take GLUON_BRANCH from build environment if specified --- get-gluon-branch.sh | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/get-gluon-branch.sh b/get-gluon-branch.sh index 35e25f116..1ad4a4b87 100755 --- a/get-gluon-branch.sh +++ b/get-gluon-branch.sh @@ -6,25 +6,23 @@ set -o pipefail # autoupdater # ==== # -# For commit builds, the autoupdater shall be off, i.e. GLUON_BRANCH unset. -# For nightly, GLUON_BRANCH must be nightly. -# For beta, GLUON_BRANCH must be beta. -# For stable, GLUON_BRANCH must be stable. - -gluon_branch="" +# This script prints the name of the autoupdater branch depending on the build +# configuration. Its output is suitable for use as the GLUON_BRANCH build +# variable of gluon. +# +# The idea is to take whatever comes in the GLUON_BRANCH build variable, +# except when this value is not one of the well-known branch names; then fall +# back to 'nightly'. -if [[ "${CI_PIPELINE_SOURCE:-}" = "schedule" ]]; then - gluon_branch="nightly" -fi +default_gluon_branch_name="nightly" -case "${CI_COMMIT_TAG:-}" in -beta/*) - gluon_branch="beta" -;; -stable/*) - gluon_branch="stable" -;; +case "${GLUON_BRANCH:-}" in + "nightly" | "beta" | "stable") + gluon_branch="$GLUON_BRANCH" + ;; + *): + gluon_branch="$default_gluon_branch_name" + ;; esac -# Else: Commit build echo $gluon_branch -- GitLab