Newer
Older
web-services / bin / version-major.sh
@Nicolas Thouvenin Nicolas Thouvenin on 21 Dec 503 bytes cleanup directory name parameter
#!/usr/bin/env bash

NAME_PACKAGE=$(basename $1)
LAST_VERSION=$(git tag | sort -n | grep "$NAME_PACKAGE" | tail -1)
MAJOR_VERSION=$(echo "$LAST_VERSION" | cut -d@ -f2 | cut -d\. -f1)

((NEW_MAJOR_VERSION=${MAJOR_VERSION:=0}+1))
NEW_VERSION="${NAME_PACKAGE}@${NEW_MAJOR_VERSION}.0.0"
git tag "${NEW_VERSION}" -m "${NEW_VERSION}"
git push --tags
echo "Nouvelle version créée: ${NEW_VERSION}"
echo "URL à utiliser: https://gitbucket.inist.fr/tdm/web-services/archive/${NAME_PACKAGE}/${NEW_VERSION}.zip"