- if [ -z "$TEST_INSTALLER" ]; then
- echo -e "\nCloning devops repo temporarily"
- git clone https://osm.etsi.org/gerrit/osm/devops.git $TEMPDIR
- RC_CLONE=$?
- fi
+ if [ -n "$TEST_INSTALLER" ]; then
+ echo -e "\nUsing local devops repo for OSM installation"
+ OSM_DEVOPS="$(dirname $(realpath $(dirname $0)))"
+ else
+ echo -e "\nCreating temporary dir for OSM installation"
+ OSM_DEVOPS="$(mktemp -d -q --tmpdir "installosm.XXXXXX")"
+ trap 'rm -rf "$OSM_DEVOPS"' EXIT
+
+ git clone https://osm.etsi.org/gerrit/osm/devops.git $OSM_DEVOPS
+
+ if [ -z "$COMMIT_ID" ]; then
+ echo -e "\nGuessing the current stable release"
+ LATEST_STABLE_DEVOPS=`git -C $OSM_DEVOPS tag -l v[0-9].* | sort -V | tail -n1`
+ [ -z "$LATEST_STABLE_DEVOPS" ] && echo "Could not find the current latest stable release" && exit 0