add clean option
This commit is contained in:
parent
9916c56721
commit
a90599279b
36
git-retag.sh
36
git-retag.sh
@ -52,6 +52,7 @@ GITEAUser=${remote_USER}
|
|||||||
GITEAACCESSTOKEN=${remote_GITEAACCESSTOKEN}
|
GITEAACCESSTOKEN=${remote_GITEAACCESSTOKEN}
|
||||||
GITEAHOST=${remote_GITEAHOST}
|
GITEAHOST=${remote_GITEAHOST}
|
||||||
NOISY=
|
NOISY=
|
||||||
|
CLEAN=
|
||||||
EXTRAPARAMS=
|
EXTRAPARAMS=
|
||||||
for param in $3 $4 $5 $6 ; do
|
for param in $3 $4 $5 $6 ; do
|
||||||
if [ $param ] ; then
|
if [ $param ] ; then
|
||||||
@ -62,11 +63,13 @@ for param in $3 $4 $5 $6 ; do
|
|||||||
GITEAHOST=${local_GITEAHOST}
|
GITEAHOST=${local_GITEAHOST}
|
||||||
;;
|
;;
|
||||||
debug )
|
debug )
|
||||||
DEBUG=true ;;
|
DEBUG=true ;;
|
||||||
noisy )
|
noisy )
|
||||||
NOISY=true ;;
|
NOISY=true ;;
|
||||||
* )
|
clean )
|
||||||
echo "Unkown parameter: $param"
|
CLEAN=true ;;
|
||||||
|
* )
|
||||||
|
echo "Unkown parameter: $param"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -130,19 +133,16 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cd $GITFiles/$REPO_NAME
|
cd $GITFiles/$REPO_NAME
|
||||||
# read the existing tags
|
if [ $CLEAN ] ; then
|
||||||
OLDTAGS=$(git tag --list)
|
# read the existing tags
|
||||||
# delete old tag/s
|
OLDTAGS=$(git tag --list)
|
||||||
for tag in $OLDTAGS ; do
|
# delete old tag/s
|
||||||
# git tag --delete $tag
|
for tag in $OLDTAGS ; do
|
||||||
# git push origin --delete $tag
|
git tag --delete $tag
|
||||||
# for some reason the remote delete is rejected, so were using the gitea API call instead
|
git push origin --delete $tag
|
||||||
if [[ $DEBUG ]] ; then echo "curl $checkSSL $SILENT4CURL -X 'DELETE' '$GITEAHOST/api/v1/orgs/$ORGGITEA/$REPO_NAME/tags/$tag' -H 'accept: application/json' -H 'Authorization: token $GITEAACCESSTOKEN'" ; fi
|
git push --tags
|
||||||
RESPONSE=$(curl "$checkSSL" "$SILENT4CURL" -X 'DELETE' \
|
done
|
||||||
"$GITEAHOST/api/v1/orgs/$ORGGITEA/$REPO_NAME/tags/$tag" \
|
fi
|
||||||
-H 'accept: application/json' \
|
|
||||||
-H "Authorization: token $GITEAACCESSTOKEN" )
|
|
||||||
done
|
|
||||||
# Now create the version and release tag from the specfile
|
# Now create the version and release tag from the specfile
|
||||||
VERSION_RELEASE_LONG=`rpm --queryformat '%{version} %{release}\n' --specfile $REPO_NAME.spec`
|
VERSION_RELEASE_LONG=`rpm --queryformat '%{version} %{release}\n' --specfile $REPO_NAME.spec`
|
||||||
VERSION_RELEASE=${VERSION_RELEASE_LONG%%$'\n'*}
|
VERSION_RELEASE=${VERSION_RELEASE_LONG%%$'\n'*}
|
||||||
|
Loading…
Reference in New Issue
Block a user