-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpush_release.sh
63 lines (40 loc) · 1.29 KB
/
push_release.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
message="$1"
while [ "$message" == "" ]
do
echo "Please enter a commit message and then press enter"
read message
done
version="0"
./version_incrementer.exe "./audio_manager_client/pubspec.yaml,./audio_manager_server/pubspec.yaml" false
version=`cat version.txt`
# writing Changelog
changeLogFile='CHANGELOG.md'
allChangeLogFile='CHANGELOG-ALL.md'
touch TEMPCHANGELOG.md
touch $changeLogFile
touch $allChangeLogFile
version=`cat version.txt`
version=$(echo $version| tr -d '[:space:]')
echo "## $version" > TEMPCHANGELOG.md
echo "Please enter your changelog in the TEMPCHANGELOG.md file and then press enter"
code TEMPCHANGELOG.md
read confirm
fileContents=`cat TEMPCHANGELOG.md`
while [ "$fileContents" == "## $version" ]
do
echo "Please enter your changelog in the TEMPCHANGELOG.md file and then press enter"
read confirm
fileContents=`cat TEMPCHANGELOG.md`
done
changeLogContents=`cat $allChangeLogFile`
echo -e "$fileContents\n$changeLogContents" > $allChangeLogFile
echo -e "$fileContents" > $changeLogFile
rm TEMPCHANGELOG.md
echo "====wrote CHANGELOG.md and CHANGELOG-ALL.md===="
git pull
echo "====Pulled===="
git add .
echo "====staged all git files===="
git commit -m "Updating to $version" -m "$message"
git push origin master
echo "====pushed as version $version===="