From b4e5bad9d203d3c909531dd52724d66121566184 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Wed, 9 Dec 2020 18:34:07 +0100 Subject: [PATCH] compare tag and not branch name --- monitoring/check_mobilizonchaprilorg_update | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/monitoring/check_mobilizonchaprilorg_update b/monitoring/check_mobilizonchaprilorg_update index b45ee1d..27f7582 100755 --- a/monitoring/check_mobilizonchaprilorg_update +++ b/monitoring/check_mobilizonchaprilorg_update @@ -24,12 +24,12 @@ if [ "$#" -ne 0 ]; then usage else lastVersion=$(curl -s https://framagit.org/api/v4/projects/$FRAMAGIT_PROJECT_ID/releases | jshon -a -e name|cut -d '"' -f2|grep -v '[\^\(alpha\)]'|head -n 1) - currentVersion=$(cd $LOCAL_REPO && git branch | grep '*'|cut -c 19-100 ) - # la branche se nomme ainsi "chapril-working-1.0.2" donc pour comparer uniquement les numéros de version on enlève le début du nom + currentVersion=$(cd $LOCAL_REPO && git describe --exact-match --tags $(git log -n1 --pretty='%h') |cut -c 9-100 ) + # le tag se nomme ainsi "chapril-1.0.2" donc pour comparer uniquement les numéros de version on enlève le début du nom - #echo "current version: $currentVersion" - #echo "last version: $lastVersion" - if [ $currentVersion = $lastVersion ]; then + echo "current version: $currentVersion" + echo "last version: $lastVersion" + if [ "$currentVersion" = "$lastVersion" ]; then echo "OK" result=0 else