-
Notifications
You must be signed in to change notification settings - Fork 37
/
make_logs
42 lines (35 loc) · 1.55 KB
/
make_logs
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
#!/usr/bin/env bash
##############################################################################
##
## Changelog creation script for use with Git Shell & Drone.io
## Created by Funwayguy for EnviroMine 1.2.x
##
##############################################################################
# Create document for update notice
echo $ver_num > version.txt
echo "https://github.com/Funwayguy/EnviroMine/wiki/Downloads" >> version.txt
echo. >> version.txt
git log -1 --pretty=format:"%B" >> version.txt
# Start writing full changelog
echo "----- Full EnviroMine Changelog (1.7.10) -----" > full_changelog.txt
echo "NOTE: Version numbers may be inaccurate where builds have failed" >> full_changelog.txt
echo "" >> full_changelog.txt
echo "[#$DRONE_BUILD_NUMBER]------------------------------------------" >> full_changelog.txt
echo "" >> full_changelog.txt
git log -1 --pretty=format:"%B" >> full_changelog.txt
iver=0
# Loop through known build numbers
for i in $(eval echo "{1..$DRONE_BUILD_NUMBER}")
do
let iver=$DRONE_BUILD_NUMBER-$i
echo "" >> full_changelog.txt
echo "[#$iver]------------------------------------------" >> full_changelog.txt
echo "" >> full_changelog.txt
git log master -1 --skip=$i --pretty=format:"%B" --first-parent >> full_changelog.txt
done
#Write changelogs older than drone.io's build counter
let iver=$DRONE_BUILD_NUMBER+1
echo "" >> full_changelog.txt
echo "[Older]---------------------------------------" >> full_changelog.txt
echo "" >> full_changelog.txt
git log master --skip=$iver --pretty=format:"%B" --first-parent >> full_changelog.txt