#!/bin/bash # This script generates the Debian package changelog file from the annotated # tags doing back from the current HEAD. If you update a debian package # without changing the agent bundle, you should make an annotated tag of the # form "-deb where should start at 2 # (the first revision is implicitly set to 1 if there is no debian tag). set -exuo pipefail agent_version=$1 deb_revision=$2 git="git --git-dir /git-repo --bare" # Construct the changelog from git annotated tags dch --create --empty --package signalfx-agent -v 0.0.0-1 tag=v$agent_version if (( $deb_revision > 1 )); then tag=$tag-deb${deb_revision} fi message="$($git tag -l --format='%(contents)' $tag)" if [[ -z $message ]]; then message="Release of $tag" fi dch -v $agent_version-$deb_revision --distribution all "${message}" cat debian/changelog