compare tag and not branch name
This commit is contained in:
parent
d51311a0c5
commit
b4e5bad9d2
@ -24,12 +24,12 @@ if [ "$#" -ne 0 ]; then
|
|||||||
usage
|
usage
|
||||||
else
|
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)
|
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 )
|
currentVersion=$(cd $LOCAL_REPO && git describe --exact-match --tags $(git log -n1 --pretty='%h') |cut -c 9-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
|
# 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 "current version: $currentVersion"
|
||||||
#echo "last version: $lastVersion"
|
echo "last version: $lastVersion"
|
||||||
if [ $currentVersion = $lastVersion ]; then
|
if [ "$currentVersion" = "$lastVersion" ]; then
|
||||||
echo "OK"
|
echo "OK"
|
||||||
result=0
|
result=0
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user