LP#1302113: define a file for storing lists of folks to acknowledge in the release...
[working/Evergreen.git] / docs / RELEASE_NOTES_NEXT / create_release_notes.sh
1 #!/bin/bash
2
3 ver=
4 while getopts r: opt; do
5   case $opt in
6   r)
7       ver=$OPTARG
8       ;;
9   esac
10 done
11
12 if [ -z "$ver" ]; then echo "I need a version: -r"; exit; fi
13
14 outfile="../RELEASE_NOTES_$ver.txt"
15
16 title="Evergreen $ver Release Notes"
17
18 echo $title > $outfile;
19 for j in `seq 1 ${#title}`; do echo -n '='; done >> $outfile
20
21 echo >> $outfile
22 echo ':toc:' >> $outfile
23 echo ':numbered:' >> $outfile
24 echo >> $outfile
25 echo Upgrade notes >> $outfile
26 echo ------------- >> $outfile
27 echo >> $outfile
28
29
30 for i in `ls -l|grep ^d|awk '{print $9}'`; do
31     files=$(ls $i/*txt 2>/dev/null)
32     if [ "_$files" != "_" ]; then
33         echo >> $outfile
34         echo >> $outfile
35         echo $i >> $outfile
36         for j in `seq 1 ${#i}`; do echo -n '~'; done >> $outfile
37         echo >> $outfile
38         echo >> $outfile
39
40         for j in $files; do
41             echo >> $outfile
42             echo >> $outfile
43             cat $j >> $outfile
44             echo >> $outfile
45             echo >> $outfile
46         done
47     fi
48 done
49
50 files=$(ls *txt 2>/dev/null)
51 if [ "_$files" != "_" ]; then
52     echo >> $outfile
53     echo Miscellaneous >> $outfile
54     echo ------------- >> $outfile
55     echo >> $outfile
56     for j in $files; do
57         cat $j >> $outfile
58     done
59 fi
60
61 if [ -f _acknowledgments ]; then
62     echo >> $outfile
63     echo "Acknowledgments" >> $outfile
64     echo "---------------" >> $outfile
65     cat _acknowledgments >> $outfile
66     echo >> $outfile
67 fi