Git based revisions for builds without git tags

pull/108/head
Vlastimil Holer 7 years ago
parent 106db183e2
commit ae70e77911
No known key found for this signature in database
GPG Key ID: EB549BADEFD07C53

@ -1,7 +1,10 @@
TARGETS='el6 el7 el7_ec2 suse deb deb_ec2 alpine iso'
#!/bin/bash
set -e
export DATE=$(date +%Y%m%d)
TARGETS='el6 el7 el7_ec2 suse deb deb_ec2 alpine iso'
for TARGET in $TARGETS; do
TARGET="${TARGET}" ./generate.sh
done

@ -25,6 +25,20 @@ set -e
source targets.sh
set +e
###
if [ -z "${RELEASE}" ]; then
if git describe --contains $(git rev-parse HEAD) &>/dev/null; then
RELEASE=1
else
DATE=${DATE:-$(date +%Y%m%d)}
GIT=$(git rev-parse --short HEAD)
RELEASE="0.${DATE}git${GIT}"
fi
fi
###
VERSION=${VERSION:-5.4.2}
RELEASE=${RELEASE:-1}
MAINTAINER=${MAINTAINER:-OpenNebula Systems <support@opennebula.systems>}
@ -57,6 +71,7 @@ elif [ "${TYPE}" = 'apk' ]; then
RELEASE_FULL="r${RELEASE_FULL}"
FILENAME="${NAME}-${VERSION}-${RELEASE_FULL}.${TYPE}"
elif [ "${TYPE}" = 'iso' ]; then
LABEL="${NAME}-${VERSION}"
FILENAME="${NAME}-${VERSION}-${RELEASE_FULL}.${TYPE}"
else
FILENAME="${NAME}-${VERSION}-${RELEASE_FULL}.noarch.${TYPE}"
@ -113,7 +128,7 @@ if [ "${TYPE}" = 'dir' ]; then
elif [ "${TYPE}" = 'iso' ]; then
mkisofs -J -R -input-charset utf8 \
-m '*.iso' \
-V "${FILENAME%.*}" \
-V "${LABEL}" \
-o "${OUT}" \
$(dirname "${OUT}")

Loading…
Cancel
Save