forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release-announce.sh
executable file
·116 lines (86 loc) · 2.53 KB
/
release-announce.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/usr/bin/bash
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/kubevirt/releases/tag/"
local RELURL="$GHRELURL$FUTURERELREF"
cat <<EOF
The source code and selected binaries are available for download at:
<$RELURL>.
The primary release artifact of KubeVirt is the git tree. The release tag is
signed and can be verified using [git-evtag][git-evtag].
Pre-built containers are published on Docker Hub and can be viewed at:
<https://hub.docker.com/u/kubevirt/>.
EOF
}
shortlog() {
git shortlog -sne $RELSPANREF | sed "s/^/ /"
}
functest() {
log "Running functional tests - can take a while."
cat .release-functest | tail -n5 |
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" |
egrep "(Ran|PASS)" |
fold -sw 74 | sed -n "{ s/^/> / ; p }"
}
usage() {
echo "Usage: $0 [FUTURE_RELEASE_REF] [PREV_RELEASE_REF]"
}
main() {
log "Span: $RELSPANREF"
fold -s <<EOF | tee release-announce
---
$(summary)
$(downloads)
$(section "Notable changes")
$(release_notes)
$(section "Contributors")
$(git shortlog -sne $RELSPANREF | wc -l) people contributed to this release:
$(shortlog)
Test Results
------------
$(functest)
Additional Resources
--------------------
- Mailing list: <https://groups.google.com/forum/#!forum/kubevirt-dev>
- IRC: <irc://irc.freenode.net/#kubevirt>
- An easy to use demo: <https://github.com/kubevirt/demo>
- [How to contribute][contributing]
- [License][license]
[git-evtag]: https://github.com/cgwalters/git-evtag#using-git-evtag
[contributing]: https://github.com/kubevirt/kubevirt/blob/master/CONTRIBUTING.md
[license]: https://github.com/kubevirt/kubevirt/blob/master/LICENSE
---
git evtag sign $FUTURERELREF
EOF
}
#
# Let's get the party started
#
FUTURERELREF="$1"
RELREF="HEAD"
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