Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
docs : Automate release notes
Browse files Browse the repository at this point in the history
This patch adds a script to generate release notes.

Usage
./docs/release_notes.sh <start-commit/tag> <New-version>

start-commit/tag is the commit to start to get git changes.

Example:

$./docs/release_notes.sh 3.0.0-alpha.5 3.0.0.beta.1

Fixes #409

Signed-off-by: Jose Carlos Venegas Munoz <[email protected]>
  • Loading branch information
jcvenegas committed Aug 11, 2017
1 parent 2eeb4f4 commit d5bec43
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
92 changes: 92 additions & 0 deletions docs/release_notes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/bin/bash

script_dir=$(dirname "$0")

source "${script_dir}/../versions.txt"
from_commit="$1"
new_release="$2"

usage(){
echo "Usage $0 <commit/tag> [new-release-version]"
echo "commit/tag: will be used as start point to get release notes"
echo "new-release: new release version that will have the "
exit -1
}

if [ -z "$from_commit" ]; then
usage
fi

git fetch --tags

if [ -z "$new_release" ] ;then
runtime_version=$(cat "${script_dir}/../VERSION")
else
runtime_version="${new_release}"
fi

if git describe --exact-match --tags HEAD 2> /dev/null ;then
commit_id="$(git describe --exact-match --tags HEAD)"
else
commit_id="$(git rev-parse HEAD)"
fi



changes(){
echo "## Changes"
git log --merges "$from_commit"..HEAD | awk '/Merge pull/{getline; getline;print }' | \
while read -r pr
do
echo "- ${pr}"
done

echo ""

echo "## Shortlog"
for cr in $(git log --merges "$from_commit"..HEAD | grep 'Merge:' | awk '{print $2".."$3}');
do
git log --oneline "$cr"
done
}

limitations(){
grep -P '^###\s|^####\s|See issue' "${script_dir}/limitations.md"
}

cat << EOT
# Release ${runtime_version}
$(changes)
## Compatibility with Docker
Clear Containers ${runtime_version} is compatible with Docker ${docker_version}
## OCI Runtime Specification
Clear Containers ${runtime_version} support the OCI Runtime Specification [${oci_spec_version}][ocispec]
## Clear Linux Containers image
Clear Containers ${runtime_version} requires at least Clear Linux containers image [${clear_vm_image_version}][clearlinuximage]
## Clear Linux Containers Kernel
Clear Containers ${runtime_version} requires at least Clear Linux Containers kernel [${clear_container_kernel}][kernel]
## Installation
- [Ubuntu][ubuntu]
- [Fedora][fedora]
- [Developers][developers]
## Issues & limitations
$(limitations)
More information [Limitations][limitations]
[clearlinuximage]: https://download.clearlinux.org/releases/${clear_vm_image_version}/clear/clear-${clear_vm_image_version}-containers.img.xz
[kernel]: https://github.com/clearcontainers/linux/tree/${clear_container_kernel}
[ocispec]: https://github.com/opencontainers/runtime-spec/releases/tag/${oci_spec_version}
[limitations]: https://github.com/clearcontainers/runtime/blob/${commit_id}/docs/limitations.md
[ubuntu]: https://github.com/clearcontainers/runtime/blob/${commit_id}/docs/ubuntu-installation-guide.md
[fedora]: https://github.com/clearcontainers/runtime/blob/${commit_id}/docs/fedora-installation-guide.md
[developers]: https://github.com/clearcontainers/runtime/blob/${commit_id}/docs/developers-clear-containers-install.md
EOT
8 changes: 8 additions & 0 deletions versions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#Clear Containers image from https://download.clearlinux.org/releases/
clear_vm_image_version=16910
#Kernel configuration and patches from https://github.com/clearcontainers/linux
clear_container_kernel=cc-linux-4.9.35
#Docker suported version
docker_version=v17.06-ce
#Supported OCI spec
oci_spec_version=1.0.0-rc5

0 comments on commit d5bec43

Please sign in to comment.