Add build-helper param for existing archive for sign-git-tag target.
This commit is contained in:
parent
9286850098
commit
317622678a
2 changed files with 36 additions and 16 deletions
|
@ -176,21 +176,27 @@ eof
|
||||||
;;
|
;;
|
||||||
|
|
||||||
sign-git-tag)
|
sign-git-tag)
|
||||||
if [ $# -lt 3 ]
|
if [ $# -lt 2 ]
|
||||||
then
|
then
|
||||||
printf "usage: $0 sign-git-tag TAG AUTHTOKEN\n"
|
printf "usage: $0 sign-git-tag TAG TOKEN [ARCHIVE]\n"
|
||||||
|
printf " if ARCHIVE is not specified then it is created\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
tag="$2"
|
tag="$1"
|
||||||
if ! git rev-parse -q --verify "${tag}" >/dev/null 2>&1
|
if ! git rev-parse -q --verify "${tag}" >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
printf "Tag \"${tag}\" not found.\n"
|
printf "Tag \"${tag}\" not found.\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
token="$3"
|
token="$2"
|
||||||
archivename="cdist-${tag}.tar.gz"
|
if [ $# -ge 2 ]
|
||||||
git archive --prefix="cdist-${tag}" -o "${archivename}" "${tag}" \
|
then
|
||||||
|| exit 1
|
archivename="$3"
|
||||||
|
else
|
||||||
|
archivename="cdist-${tag}.tar.gz"
|
||||||
|
git archive --prefix="cdist-${tag}" -o "${archivename}" "${tag}" \
|
||||||
|
|| exit 1
|
||||||
|
fi
|
||||||
gpg --armor --detach-sign "${archivename}" || exit 1
|
gpg --armor --detach-sign "${archivename}" || exit 1
|
||||||
|
|
||||||
# make github release
|
# make github release
|
||||||
|
@ -217,7 +223,11 @@ eof
|
||||||
|| exit 1
|
|| exit 1
|
||||||
|
|
||||||
# remove generated files (archive and asc)
|
# remove generated files (archive and asc)
|
||||||
rm -f "${archivename}" "${archivename}.asc"
|
if [ $# -ge 2]
|
||||||
|
then
|
||||||
|
rm -f "${archivename}"
|
||||||
|
fi
|
||||||
|
rm -f "${archivename}.asc"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
release)
|
release)
|
||||||
|
|
|
@ -211,21 +211,27 @@ eof
|
||||||
;;
|
;;
|
||||||
|
|
||||||
sign-git-tag)
|
sign-git-tag)
|
||||||
if [ $# -lt 3 ]
|
if [ $# -lt 2 ]
|
||||||
then
|
then
|
||||||
printf "usage: $0 sign-git-tag TAG TOKEN\n"
|
printf "usage: $0 sign-git-tag TAG TOKEN [ARCHIVE]\n"
|
||||||
|
printf " if ARCHIVE is not specified then it is created\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
tag="$2"
|
tag="$1"
|
||||||
if ! git rev-parse -q --verify "${tag}" >/dev/null 2>&1
|
if ! git rev-parse -q --verify "${tag}" >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
printf "Tag \"${tag}\" not found.\n"
|
printf "Tag \"${tag}\" not found.\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
token="$3"
|
token="$2"
|
||||||
archivename="cdist-${tag}.tar.gz"
|
if [ $# -ge 2 ]
|
||||||
git archive --prefix="cdist-${tag}" -o "${archivename}" "${tag}" \
|
then
|
||||||
|| exit 1
|
archivename="$3"
|
||||||
|
else
|
||||||
|
archivename="cdist-${tag}.tar.gz"
|
||||||
|
git archive --prefix="cdist-${tag}" -o "${archivename}" "${tag}" \
|
||||||
|
|| exit 1
|
||||||
|
fi
|
||||||
gpg --armor --detach-sign "${archivename}" || exit 1
|
gpg --armor --detach-sign "${archivename}" || exit 1
|
||||||
|
|
||||||
# make github release
|
# make github release
|
||||||
|
@ -252,7 +258,11 @@ eof
|
||||||
|| exit 1
|
|| exit 1
|
||||||
|
|
||||||
# remove generated files (archive and asc)
|
# remove generated files (archive and asc)
|
||||||
rm -f "${archivename}" "${archivename}.asc"
|
if [ $# -ge 2]
|
||||||
|
then
|
||||||
|
rm -f "${archivename}"
|
||||||
|
fi
|
||||||
|
rm -f "${archivename}.asc"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
release)
|
release)
|
||||||
|
|
Loading…
Reference in a new issue