Skip to content

Commit 1b3788e

Browse files
committed
feat(_scripts): add CHANGELOG.md and generator script
1 parent 158a686 commit 1b3788e

2 files changed

Lines changed: 106 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
### 2.0.0-alpha -> v2.0.0-beta1
2+
3+
#### Features
4+
5+
- [`d019479`](https://github.com/deis/registry/commit/d019479ff95f9639e9981721081906aa28108959) Makefile: enable immutable (git-based
6+
- [`8924755`](https://github.com/deis/registry/commit/8924755ac2b90940ff4a5ad4348c06c252d6a32f) .travis.yml: have this job notify its sister job in Jenkins
7+
- [`da26fdc`](https://github.com/deis/registry/commit/da26fdcb907896c9528e862e274058458057d315) README.md: add badge for Travis CI build
8+
9+
#### Fixes
10+
11+
- [`3747ba3`](https://github.com/deis/registry/commit/3747ba3aade2095222ed240b0515bb64a74df57d) minio: add support for minio
12+
- [`114b892`](https://github.com/deis/registry/commit/114b8927759777fb9a70d101bba7f2a8d86ff4d9) deploy.sh: add trailing slash to quay.io/
13+
14+
#### Maintenance
15+
16+
- [`0699184`](https://github.com/deis/registry/commit/0699184961b886ceda6184c1896a77540962aead) Dockerfile: update alpine to 3.3
17+
- [`00dcbfe`](https://github.com/deis/registry/commit/00dcbfe55001805d37d0ed3affd266c442d25e3a) Dockerfile: update docker/distribution to 2.2.1
18+
- [`7b93259`](https://github.com/deis/registry/commit/7b932598b0dc57cacff2b3d0446d979c78a77cff) release: bump version to v2-beta
19+
20+
### 2.0.0-alpha
21+
22+
#### Features
23+
24+
- [`e72dfa1`](https://github.com/deis/registry/commit/e72dfa1840f088a7539e28f9cdcd5bfaf5c15149) (all): use alpine:3.2 for image base
25+
26+
#### Fixes
27+
28+
- [`01b8641`](https://github.com/deis/registry/commit/01b8641337eeaa45243d5fbdb01a899409e9b5e9) travis: connect deploy script correctly
29+
- [`570cfd6`](https://github.com/deis/registry/commit/570cfd6544b640dd03ee714a27ff391fd3ee5bc0) Makefile/deploy: use standard deploy.sh location
30+
31+
#### Documentation
32+
33+
- [`e162fda`](https://github.com/deis/registry/commit/e162fdae1f116d302bb0774ac6efd2d000012fb9) readme: add deploying documentation
34+
35+
#### Maintenance
36+
37+
- [`3c54099`](https://github.com/deis/registry/commit/3c540990c377c3ada665dc9c99884d8671b900d3) release: set version and lock to deis registry

_scripts/generate-changelog.sh

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/usr/bin/env bash
2+
# vim: et tw=0 sw=4 ts=4
3+
4+
REPOROOT=${REPOROOT:=https://github.com/deis/registry}
5+
TYPES=${TYPES:=feat(;Features fix(;Fixes docs(;Documentation chore(;Maintenance}
6+
7+
usage() {
8+
echo "Usage: $0 <from> [to]
9+
10+
The REPOROOT and TYPES variables may be used to customize what links are
11+
generated and what is scraped from the commit logs. Current settings are:
12+
13+
REPOROOT=$REPOROOT
14+
TYPES=$TYPES
15+
"
16+
}
17+
18+
# Print the information scraped from git
19+
retrieve() {
20+
while read -r commit hash message; do
21+
# Extract the subsystem where type(subsystem): message
22+
SUBSYSTEM=$(echo "$message" | cut -d'(' -f2 | cut -d')' -f1 | sed 's/\*/\(all\)/g')
23+
# Extract the message where type(subsystem): message
24+
MESSAGE=$(echo "$message" | awk -F ")" '{ print $2}' | sed 's/://' | cut -f2- -d' ')
25+
# Generate a link to the full legal commit on GitHub
26+
LINK="$REPOROOT/commit/$hash"
27+
# Echo all this in a way that makes the commit hash and message a link
28+
# to the commit in markdown
29+
echo ' -' "[\`$commit\`]($LINK)" "$SUBSYSTEM": "$MESSAGE"
30+
done < <(git --no-pager log --oneline --merges --oneline --format="%h %H %b" --grep="$1" "$FROM".."$TO")
31+
# Scrape the information from git
32+
}
33+
34+
# Wrap feature type and show its relevant commits
35+
subheading() {
36+
echo "#### $1"
37+
echo
38+
retrieve "$2"
39+
echo
40+
}
41+
42+
main() {
43+
# Print usage summary if user didn't specify a beginning
44+
if [ -z "$1" ]; then
45+
usage
46+
exit 1
47+
fi
48+
49+
FROM=$1
50+
TO=${2:-"HEAD"}
51+
52+
printf "### %s -> %s\n\n" "$FROM" "$TO"
53+
54+
# Iterate over the types of messages specified
55+
for LEGALTYPE in $TYPES; do
56+
SHORT=$(echo "$LEGALTYPE" | cut -f1 -d';')
57+
LONG=$(echo "$LEGALTYPE" | cut -f2 -d';')
58+
subheading "$LONG" "$SHORT"
59+
done
60+
}
61+
62+
if [ $SHLVL -eq 2 ]; then
63+
# If this is being run as a command
64+
main "$*"
65+
else
66+
# Otherwise this is being sourced
67+
unset -f main
68+
unset -f usage
69+
fi

0 commit comments

Comments
 (0)