forked from pgjdbc/pgjdbc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease_notes.sh
More file actions
executable file
·46 lines (37 loc) · 1.3 KB
/
release_notes.sh
File metadata and controls
executable file
·46 lines (37 loc) · 1.3 KB
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
#!/bin/bash
CURRENT_VERSION=`mvn -B -N org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\['`
VERS=${CURRENT_VERSION/-SNAPSHOT}
DATE_YMD=$(date '+%Y-%m-%d')
RELEASE_FILE=$(find docs/_posts -name "*-$VERS-release.md" | head -n 1)
if [[ "x$RELEASE_FILE" == "x" ]]; then
RELEASE_FILE=docs/_posts/$DATE_YMD-$VERS-release.md
fi
echo file: $RELEASE_FILE
if [ -f $RELEASE_FILE ]; then
if [[ "x$1" == "x-o" ]]; then
echo Removing file $RELEASE_FILE
rm "$RELEASE_FILE"
fi
fi
if [ -f $RELEASE_FILE ]; then
echo File $RELEASE_FILE already exists. If you want to overwrite it, pass -o parameter
else
# Makes all the output get printed to the file as well (concept from http://stackoverflow.com/a/3403786/267224)
exec > >(tee -a $RELEASE_FILE)
exec 2>&1
fi
PREV_VERSION=`git describe --match 'REL*' --abbrev=0`
echo ---
echo title: "PostgreSQL JDBC Driver ${VERS} Released"
echo date: $(date '+%Y-%m-%d %H:%M:%S %z')
echo categories:
echo ' - new_release'
echo version: ${VERS}
echo ---
echo **Notable changes**
echo
echo '*'
echo
echo '<!--more-->'
echo
git shortlog --format="%s@@@%H@@@%h@@@" --grep="maven-release-plugin|update versions in readme.md" --extended-regexp --invert-grep --no-merges $PREV_VERSION..HEAD | perl release_notes_filter.pl ${VERS}