#!/usr/bin/env bash set -eou pipefail underline() { echo "$2" printf "%0.s$1" $(seq ${#2}) } log() { echo "$@" >&2; } title() { underline "=" "$@"; } section() { underline "-" "$@"; } # # All sorts of content # release_notes() { log "Fetching release notes" cat manual-release-notes || echo "FIXME manual notes needed" } summary() { log "Building summary" echo "This release follows $PREREF and consists of $(git log --oneline $RELSPANREF | wc -l) changes, contributed by" echo -n "$(git shortlog -sne $RELSPANREF | wc -l) people, leading to" echo "$(git diff --shortstat $RELSPANREF)." } downloads() { log "Adding download urls" local GHRELURL="https://github.com/kubevirt/containerized-data-importer/releases/tag/" local RELURL="$GHRELURL$RELREF" cat <. Pre-built CDI containers are published on Docker Hub and can be viewed at: EOF } shortlog() { git shortlog -sne --no-merges $RELSPANREF | sed "s/^/ /" } usage() { echo "Usage: $0 [RELEASE_REF] [PREV_RELEASE_REF]" } main() { log "Span: $RELSPANREF" cat < - [How to contribute][contributing] - [License][license] [contributing]: https://github.com/kubevirt/containerized-data-importer/blob/master/hack/README.md [license]: https://github.com/kubevirt/containerized-data-importer/blob/master/LICENSE EOF } # # Let's get the party started # RELREF="$1" PREREF="$2" RELREF=${RELREF:-$(git describe --abbrev=0 --tags)} PREREF=${PREREF:-$(git describe --abbrev=0 --tags $RELREF^)} RELSPANREF=$PREREF..$RELREF main # vim: sw=2 et