Fix warning about GERRIT_BRANCH parameter not set in devops-stages/stage-test.sh 54/14554/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 11 Sep 2024 13:05:49 +0000 (15:05 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 11 Sep 2024 13:05:49 +0000 (15:05 +0200)
Change-Id: Ia18af15a204c37283086a9328d3b97e764cdfb8f
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
devops-stages/stage-test.sh

index 175835f..8edc11c 100755 (executable)
@@ -22,6 +22,8 @@ CURRENT_DIR=`pwd`
 CHARM_PATH="./installers/charm"
 NEW_CHARMS_NAMES="osm-keystone osm-lcm osm-mon osm-nbi osm-ng-ui osm-pol osm-ro vca-integrator-operator"
 OLD_CHARMS_NAMES="prometheus grafana"
+LOCAL_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
+GERRIT_BRANCH=${GERRIT_BRANCH:-${LOCAL_GIT_BRANCH}}
 for charm in $NEW_CHARMS_NAMES; do
     if [ $(git diff --name-only "origin/${GERRIT_BRANCH}" -- "installers/charm/${charm}" | wc -l) -ne 0 ]; then
         echo "Running tox for ${charm}"