#!/bin/bash -eu # # Tag a release # function usage() { cat <&2 exit 2 ;; esac shift done version=$(git log --format='%s' -1 | sed -n 's/^UBUNTU: Ubuntu-//p') if [ -z "${version}" ] ; then echo "Current HEAD is not an Ubuntu release commit" >&2 exit 1 fi tag=Ubuntu-${version} if [ ${force} -eq 0 ] && git rev-parse "${tag}" >/dev/null 2>&1 ; then echo "Tag exists already: ${tag}" >&2 exit 1 fi git tag -f -s -m "UBUNTU: ${tag}" "${tag}"